summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-10-27 19:59:58 +0100
committerGitHub <noreply@github.com>2020-10-27 19:59:58 +0100
commite9cfc6fd1035c28a7156ff91d66b3beab7596ebf (patch)
tree96852c74ca80899ae4b4915e09078b12a458467a
parent93bc5ea744f11bea6091cb24287179047eb8d3c5 (diff)
parent09d4aa30101d0d078c2f14032b73f9181259b505 (diff)
downloadnextcloud-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.php6
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'));