Theming: adjust background image resizing
Support high resolution login images by resizing only images that are wider than 4096px fixes #7459 Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
fdd7a53250
commit
422e20569b
1 changed files with 4 additions and 6 deletions
|
@ -288,12 +288,10 @@ class ThemingController extends Controller {
|
||||||
// Optimize the image since some people may upload images that will be
|
// Optimize the image since some people may upload images that will be
|
||||||
// either to big or are not progressive rendering.
|
// either to big or are not progressive rendering.
|
||||||
$tmpFile = $this->tempManager->getTemporaryFile();
|
$tmpFile = $this->tempManager->getTemporaryFile();
|
||||||
if (function_exists('imagescale')) {
|
$newWidth = imagesx($image) < 4096 ? imagesx($image) : 4096;
|
||||||
// FIXME: Once PHP 5.5.0 is a requirement the above check can be removed
|
$newHeight = imagesy($image) / (imagesx($image) / $newWidth);
|
||||||
// Workaround for https://bugs.php.net/bug.php?id=65171
|
$image = imagescale($image, $newWidth, $newHeight);
|
||||||
$newHeight = imagesy($image) / (imagesx($image) / 1920);
|
|
||||||
$image = imagescale($image, 1920, $newHeight);
|
|
||||||
}
|
|
||||||
imageinterlace($image, 1);
|
imageinterlace($image, 1);
|
||||||
imagejpeg($image, $tmpFile, 75);
|
imagejpeg($image, $tmpFile, 75);
|
||||||
imagedestroy($image);
|
imagedestroy($image);
|
||||||
|
|
Loading…
Reference in a new issue