check if ->resource is a resource

This commit is contained in:
Georg Ehrke 2013-08-15 16:13:01 +02:00
parent 7a11911aea
commit 4574c5cf5c

View File

@ -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);