]> source.dussan.org Git - nextcloud-server.git/commitdiff
Workaround for PHP bug when calling imagescale 2232/head
authorJulius Haertl <jus@bitgrid.net>
Tue, 22 Nov 2016 11:12:59 +0000 (12:12 +0100)
committerJulius Haertl <jus@bitgrid.net>
Tue, 22 Nov 2016 11:12:59 +0000 (12:12 +0100)
Signed-off-by: Julius Haertl <jus@bitgrid.net>
apps/theming/lib/Controller/ThemingController.php

index 58e843c5d9d29d716af0c0179f11860c2c4ad180..73e3ed3a4b47ef2409224e20168580747cb4a2b4 100644 (file)
@@ -211,7 +211,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);