summaryrefslogtreecommitdiffstats
path: root/apps/theming
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-10-27 09:06:12 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-10-27 09:06:12 +0100
commit09d4aa30101d0d078c2f14032b73f9181259b505 (patch)
tree8404531cc4f0ce04076077ac70a4fe4da49f0f48 /apps/theming
parent238435f9b56803b226704e3ea9e37cf5931c61bb (diff)
downloadnextcloud-server-09d4aa30101d0d078c2f14032b73f9181259b505.tar.gz
nextcloud-server-09d4aa30101d0d078c2f14032b73f9181259b505.zip
Enable theming background transparency
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/theming')
-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'));