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:
authorkondou <kondou@ts.unde.re>2014-08-12 13:00:00 +0400
committerMorris Jobke <hey@morrisjobke.de>2014-09-16 10:34:18 +0400
commit86400ea4c89d7141b6122a5a0fda3b6a16987ccc (patch)
tree5dcd449348fc10719cfd6b056bd222f59b39506a /lib/private/image.php
parentff6deb809a7953a1e0b2199d63fb1a131565a607 (diff)
Preserve transparency when loading from a file
Fix #7148 - again :)
Diffstat (limited to 'lib/private/image.php')
-rw-r--r--lib/private/image.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/image.php b/lib/private/image.php
index 0dff8c5a9da..c055c693f62 100644
--- a/lib/private/image.php
+++ b/lib/private/image.php
@@ -450,6 +450,9 @@ class OC_Image {
case IMAGETYPE_GIF:
if (imagetypes() & IMG_GIF) {
$this->resource = imagecreatefromgif($imagePath);
+ // Preserve transparency
+ imagealphablending($this->resource, true);
+ imagesavealpha($this->resource, true);
} else {
OC_Log::write('core',
'OC_Image->loadFromFile, GIF images not supported: '.$imagePath,
@@ -468,6 +471,9 @@ class OC_Image {
case IMAGETYPE_PNG:
if (imagetypes() & IMG_PNG) {
$this->resource = imagecreatefrompng($imagePath);
+ // Preserve transparency
+ imagealphablending($this->resource, true);
+ imagesavealpha($this->resource, true);
} else {
OC_Log::write('core',
'OC_Image->loadFromFile, PNG images not supported: '.$imagePath,