From c96bbd4953c84d2fe005f3ba161df056ac48e24c Mon Sep 17 00:00:00 2001 From: Julius Haertl Date: Tue, 22 Nov 2016 12:12:59 +0100 Subject: [PATCH] Workaround for PHP bug when calling imagescale Signed-off-by: Julius Haertl --- apps/theming/lib/Controller/ThemingController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php index 24fa10e89aa..bd3260980ee 100644 --- a/apps/theming/lib/Controller/ThemingController.php +++ b/apps/theming/lib/Controller/ThemingController.php @@ -208,7 +208,9 @@ class ThemingController extends Controller { $tmpFile = $this->tempManager->getTemporaryFile(); if(function_exists('imagescale')) { // FIXME: Once PHP 5.5.0 is a requirement the above check can be removed - $image = imagescale($image, 1920); + // Workaround for https://bugs.php.net/bug.php?id=65171 + $newHeight = imagesy($image)/(imagesx($image)/1920); + $image = imagescale($image, 1920, $newHeight); } imageinterlace($image, 1); imagejpeg($image, $tmpFile, 75); -- 2.39.5