Add fallback to FILTER_LANCZOS for icon resizing

Signed-off-by: Julius Haertl <jus@bitgrid.net>
This commit is contained in:
Julius Haertl 2016-12-09 11:51:02 +01:00
parent 60e4299bcb
commit 366f14d7db
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF

View file

@ -159,7 +159,12 @@ class IconBuilder {
$finalIconFile->setImageArtifact('compose:args', "1,0,-0.5,0.5");
$finalIconFile->compositeImage($appIconFile, Imagick::COMPOSITE_ATOP, $offset_w, $offset_h);
$finalIconFile->setImageFormat('png24');
$finalIconFile->resizeImage($size, $size, Imagick::INTERPOLATE_BICUBIC, 1, false);
if (defined("Imagick::INTERPOLATE_BICUBIC") === true) {
$filter = Imagick::INTERPOLATE_BICUBIC;
} else {
$filter = Imagick::FILTER_LANCZOS;
}
$finalIconFile->resizeImage($size, $size, $filter, 1, false);
$appIconFile->destroy();
return $finalIconFile;