aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/image.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/image.php b/lib/image.php
index 53ffb24d18c..840b744ad72 100644
--- a/lib/image.php
+++ b/lib/image.php
@@ -496,8 +496,10 @@ class OC_Image {
return false;
}
$this->resource = @imagecreatefromstring($str);
- imagealphablending($this->resource, false);
- imagesavealpha($this->resource, true);
+ if(is_resource($this->resource)) {
+ imagealphablending($this->resource, false);
+ imagesavealpha($this->resource, true);
+ }
if(!$this->resource) {
OC_Log::write('core', 'OC_Image->loadFromData, couldn\'t load', OC_Log::DEBUG);