Workaround for PHP bug when calling imagescale

Signed-off-by: Julius Haertl <jus@bitgrid.net>
This commit is contained in:
Julius Haertl 2016-11-22 12:12:59 +01:00
parent fee91b1073
commit c96bbd4953
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 3 additions and 1 deletions

View File

@ -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);