Skip to content

Commit 02bbce3

Browse files
come-ncbackportbot[bot]
authored andcommitted
fix(theming): Fix favicon and touchicon ratios
On some systems (depending on imagick version I think) the ratio would be messed up on the touchicon, favicon and link preview images. This fixes it without breaking other systems. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent 2f1de79 commit 02bbce3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

apps/theming/lib/IconBuilder.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,8 @@ public function renderAppIcon($app, $size) {
136136

137137
// convert svg to resized image
138138
$appIconFile = new Imagick();
139-
$resX = (int)(72 * $size / $x);
140-
$resY = (int)(72 * $size / $y);
141-
$appIconFile->setResolution($resX, $resY);
139+
$res = (int)(72 * $size / max($x, $y));
140+
$appIconFile->setResolution($res, $res);
142141
$appIconFile->setBackgroundColor(new ImagickPixel('transparent'));
143142
$appIconFile->readImageBlob($svg);
144143

0 commit comments

Comments
 (0)