Fixed cover read error.
This commit is contained in:
parent
6a0f20d24b
commit
ce9a50e709
1 changed files with 17 additions and 11 deletions
|
@ -57,18 +57,24 @@ if(in_array($reqPath, [
|
|||
$hasCover = $nowPlaying && is_file(NP_COVER_IMG);
|
||||
|
||||
if($hasCover) {
|
||||
$imagickDraw->rectangle(
|
||||
SIG_WIDTH - (NP_COVER_RES + NP_COVER_PAD) - NP_COVER_FRAME,
|
||||
NP_COVER_PAD - NP_COVER_FRAME,
|
||||
SIG_WIDTH - (NP_COVER_RES + NP_COVER_PAD) + NP_COVER_RES,
|
||||
NP_COVER_PAD + NP_COVER_RES,
|
||||
);
|
||||
$imagick->drawImage($imagickDraw);
|
||||
try {
|
||||
$imagickDraw->rectangle(
|
||||
SIG_WIDTH - (NP_COVER_RES + NP_COVER_PAD) - NP_COVER_FRAME,
|
||||
NP_COVER_PAD - NP_COVER_FRAME,
|
||||
SIG_WIDTH - (NP_COVER_RES + NP_COVER_PAD) + NP_COVER_RES,
|
||||
NP_COVER_PAD + NP_COVER_RES,
|
||||
);
|
||||
|
||||
$npCover = new Imagick(NP_COVER_IMG);
|
||||
$npCover->resizeImage(NP_COVER_RES, NP_COVER_RES, Imagick::FILTER_CATROM, 0.9, true);
|
||||
$imagick->compositeImage($npCover, Imagick::COMPOSITE_COPY, SIG_WIDTH - (NP_COVER_RES + NP_COVER_PAD), NP_COVER_PAD);
|
||||
$npCover->destroy();
|
||||
$npCover = new Imagick(NP_COVER_IMG);
|
||||
$npCover->resizeImage(NP_COVER_RES, NP_COVER_RES, Imagick::FILTER_CATROM, 0.9, true);
|
||||
|
||||
$imagick->drawImage($imagickDraw);
|
||||
$imagick->compositeImage($npCover, Imagick::COMPOSITE_COPY, SIG_WIDTH - (NP_COVER_RES + NP_COVER_PAD), NP_COVER_PAD);
|
||||
|
||||
$npCover->destroy();
|
||||
} catch(ImagickException $ex) {
|
||||
$hasCover = false;
|
||||
}
|
||||
}
|
||||
|
||||
$imagickDraw->setFillColor(BG_IMAGE === 'bg4.png' ? $ip_000 : $ip_fff);
|
||||
|
|
Loading…
Reference in a new issue