diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-01-19 14:14:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-19 14:14:25 +0100 |
commit | 34a3613a6463b18f8e095e42122afc8a07ce2a13 (patch) | |
tree | 3d4b11a3b7b03f316d9030394e0f4f4247e57e0c /apps | |
parent | fdd7a5325006d5ff023f04fab32627e08393f053 (diff) | |
parent | 422e20569b1a84f5b1845474abed630e39daa3cf (diff) | |
download | nextcloud-server-34a3613a6463b18f8e095e42122afc8a07ce2a13.tar.gz nextcloud-server-34a3613a6463b18f8e095e42122afc8a07ce2a13.zip |
Merge pull request #7953 from nextcloud/theming-background-highres
Theming: adjust background image resizing
Diffstat (limited to 'apps')
-rw-r--r-- | apps/theming/lib/Controller/ThemingController.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php index 6592eb7f7ab..f27841c0042 100644 --- a/apps/theming/lib/Controller/ThemingController.php +++ b/apps/theming/lib/Controller/ThemingController.php @@ -288,12 +288,10 @@ class ThemingController extends Controller { // Optimize the image since some people may upload images that will be // either to big or are not progressive rendering. $tmpFile = $this->tempManager->getTemporaryFile(); - if (function_exists('imagescale')) { - // FIXME: Once PHP 5.5.0 is a requirement the above check can be removed - // Workaround for https://bugs.php.net/bug.php?id=65171 - $newHeight = imagesy($image) / (imagesx($image) / 1920); - $image = imagescale($image, 1920, $newHeight); - } + $newWidth = imagesx($image) < 4096 ? imagesx($image) : 4096; + $newHeight = imagesy($image) / (imagesx($image) / $newWidth); + $image = imagescale($image, $newWidth, $newHeight); + imageinterlace($image, 1); imagejpeg($image, $tmpFile, 75); imagedestroy($image); |