Merge pull request #2584 from nextcloud/theming-filter-fix

Add fallback to FILTER_LANCZOS for icon resizing
This commit is contained in:
Joas Schilling 2016-12-09 14:53:34 +01:00 committed by GitHub
commit de8908bf29
1 changed files with 6 additions and 1 deletions

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;