summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <hey@jancborchardt.net>2014-07-30 18:36:51 +0200
committerJan-Christoph Borchardt <hey@jancborchardt.net>2014-07-30 18:36:51 +0200
commit5b11a18deaed85db34ad7b1e933ae806156c858e (patch)
tree1c8413f0b6a1b1f43e8e2de413b27e2a3a3689ce /lib
parent521934ee0d72831fc38b8a8179fd709ec341aea8 (diff)
parentfa461befbc940a6dd5dd40843551d2c3d1a3c34b (diff)
downloadnextcloud-server-5b11a18deaed85db34ad7b1e933ae806156c858e.tar.gz
nextcloud-server-5b11a18deaed85db34ad7b1e933ae806156c858e.zip
Merge pull request #10044 from owncloud/transparency_fix
extract transparency fix from #8050
Diffstat (limited to 'lib')
-rw-r--r--lib/private/image.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/image.php b/lib/private/image.php
index 5331c399159..0dff8c5a9da 100644
--- a/lib/private/image.php
+++ b/lib/private/image.php
@@ -870,6 +870,14 @@ class OC_Image {
imagedestroy($process);
return false;
}
+
+ // preserve transparency
+ if($this->imageType == IMAGETYPE_GIF or $this->imageType == IMAGETYPE_PNG) {
+ imagecolortransparent($process, imagecolorallocatealpha($process, 0, 0, 0, 127));
+ imagealphablending($process, false);
+ imagesavealpha($process, true);
+ }
+
imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $w, $h, $w, $h);
if ($process == false) {
OC_Log::write('core', __METHOD__.'(): Error resampling process image '.$w.'x'.$h, OC_Log::ERROR);