diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-10-26 20:47:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-26 20:47:28 +0100 |
commit | 6dd37853325e9d85718bf3fb656000aee057a63e (patch) | |
tree | 434fa4912d16045dcc8de4d80085d0ac6a294379 /apps | |
parent | e7a8061130d7c7ef5ce44d96600d3248c940ffa6 (diff) | |
parent | 68f1f44e58ffee480e233e32c8756c4dafbd926d (diff) | |
download | nextcloud-server-6dd37853325e9d85718bf3fb656000aee057a63e.tar.gz nextcloud-server-6dd37853325e9d85718bf3fb656000aee057a63e.zip |
Merge pull request #23680 from nextcloud/fix/theming/background-transparency
Enable theming background transparency
Diffstat (limited to 'apps')
-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)); |