diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-10-27 19:59:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-27 19:59:58 +0100 |
commit | e9cfc6fd1035c28a7156ff91d66b3beab7596ebf (patch) | |
tree | 96852c74ca80899ae4b4915e09078b12a458467a | |
parent | 93bc5ea744f11bea6091cb24287179047eb8d3c5 (diff) | |
parent | 09d4aa30101d0d078c2f14032b73f9181259b505 (diff) | |
download | nextcloud-server-e9cfc6fd1035c28a7156ff91d66b3beab7596ebf.tar.gz nextcloud-server-e9cfc6fd1035c28a7156ff91d66b3beab7596ebf.zip |
Merge pull request #23705 from nextcloud/backport/23680/stable19
[stable19] Enable theming background transparency
-rw-r--r-- | apps/theming/lib/Controller/ThemingController.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php index b7e783b9cd5..241f88dde68 100644 --- a/apps/theming/lib/Controller/ThemingController.php +++ b/apps/theming/lib/Controller/ThemingController.php @@ -285,13 +285,17 @@ class ThemingController extends Controller { // either to big or are not progressive rendering. $newImage = @imagecreatefromstring(file_get_contents($image['tmp_name'], 'r')); + // Preserve transparency + imagesavealpha($newImage, true); + imagealphablending($newImage, true); + $tmpFile = $this->tempManager->getTemporaryFile(); $newWidth = imagesx($newImage) < 4096 ? imagesx($newImage) : 4096; $newHeight = imagesy($newImage) / (imagesx($newImage) / $newWidth); $outputImage = imagescale($newImage, $newWidth, $newHeight); imageinterlace($outputImage, 1); - imagejpeg($outputImage, $tmpFile, 75); + imagepng($outputImage, $tmpFile, 8); imagedestroy($outputImage); $target->putContent(file_get_contents($tmpFile, 'r')); |