diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-10-25 19:15:52 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-10-25 19:15:52 +0100 |
commit | 68f1f44e58ffee480e233e32c8756c4dafbd926d (patch) | |
tree | 0b4fe0007fcbc18b9e18c0bf5bfe85c9b981e022 /apps/theming | |
parent | 2a154f57ceeae89b15dfe166aff3a7916afde94c (diff) | |
download | nextcloud-server-68f1f44e58ffee480e233e32c8756c4dafbd926d.tar.gz nextcloud-server-68f1f44e58ffee480e233e32c8756c4dafbd926d.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/ImageManager.php | 6 |
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)); |