diff options
author | Georg Ehrke <developer@georgehrke.com> | 2013-08-15 16:13:01 +0200 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2013-08-15 16:13:01 +0200 |
commit | 4574c5cf5cbb9efc4f787b264842573540f88439 (patch) | |
tree | 7ab86005843be05e61c59f75b24ece814ed7a1c5 /lib | |
parent | 7a11911aead74e07ba2917be27e343ff93ca931f (diff) | |
download | nextcloud-server-4574c5cf5cbb9efc4f787b264842573540f88439.tar.gz nextcloud-server-4574c5cf5cbb9efc4f787b264842573540f88439.zip |
check if ->resource is a resource
Diffstat (limited to 'lib')
-rw-r--r-- | lib/image.php | 6 |
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); |