Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-10-25 21:15:52 +0300
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-10-25 21:15:52 +0300
commit68f1f44e58ffee480e233e32c8756c4dafbd926d (patch)
tree0b4fe0007fcbc18b9e18c0bf5bfe85c9b981e022 /apps/theming
parent2a154f57ceeae89b15dfe166aff3a7916afde94c (diff)
Enable theming background transparency
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/theming')
-rw-r--r--apps/theming/lib/ImageManager.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/theming/lib/ImageManager.php b/apps/theming/lib/ImageManager.php
index 2b58fa499f4..a50522cd895 100644
--- a/apps/theming/lib/ImageManager.php
+++ b/apps/theming/lib/ImageManager.php
@@ -228,13 +228,17 @@ class ImageManager {
// either to big or are not progressive rendering.
$newImage = @imagecreatefromstring(file_get_contents($tmpFile));
+ // Preserve transparency
+ imagesavealpha($newImage, true);
+ imagealphablending($newImage, true);
+
$tmpFile = $this->tempManager->getTemporaryFile();
$newWidth = (int)(imagesx($newImage) < 4096 ? imagesx($newImage) : 4096);
$newHeight = (int)(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));