From 02bbce389e190439a0d8e235f49c84ed207fc1bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 20 Jan 2026 11:44:45 +0100 Subject: [PATCH] fix(theming): Fix favicon and touchicon ratios MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- apps/theming/lib/IconBuilder.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/theming/lib/IconBuilder.php b/apps/theming/lib/IconBuilder.php index 63f4559970dfe..25dedccc6f5c2 100644 --- a/apps/theming/lib/IconBuilder.php +++ b/apps/theming/lib/IconBuilder.php @@ -136,9 +136,8 @@ public function renderAppIcon($app, $size) { // convert svg to resized image $appIconFile = new Imagick(); - $resX = (int)(72 * $size / $x); - $resY = (int)(72 * $size / $y); - $appIconFile->setResolution($resX, $resY); + $res = (int)(72 * $size / max($x, $y)); + $appIconFile->setResolution($res, $res); $appIconFile->setBackgroundColor(new ImagickPixel('transparent')); $appIconFile->readImageBlob($svg);