don't try and load an empty string as a photo
This commit is contained in:
parent
641e69ef7f
commit
d63de4dbe2
@ -17,6 +17,9 @@ class photo_gd extends photo_driver {
|
||||
|
||||
function load($data, $type) {
|
||||
$this->valid = false;
|
||||
if(! $data)
|
||||
return;
|
||||
|
||||
$this->image = @imagecreatefromstring($data);
|
||||
if($this->image !== FALSE) {
|
||||
$this->valid = true;
|
||||
|
@ -27,6 +27,10 @@ class photo_imagick extends photo_driver {
|
||||
function load($data, $type) {
|
||||
$this->valid = false;
|
||||
$this->image = new Imagick();
|
||||
|
||||
if(! $data)
|
||||
return;
|
||||
|
||||
$this->image->readImageBlob($data);
|
||||
|
||||
|
||||
@ -71,9 +75,9 @@ class photo_imagick extends photo_driver {
|
||||
if((! $quality) || ($quality > 100))
|
||||
$quality = JPEG_QUALITY;
|
||||
$this->image->setCompressionQuality($quality);
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user