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) {
|
function load($data, $type) {
|
||||||
$this->valid = false;
|
$this->valid = false;
|
||||||
|
if(! $data)
|
||||||
|
return;
|
||||||
|
|
||||||
$this->image = @imagecreatefromstring($data);
|
$this->image = @imagecreatefromstring($data);
|
||||||
if($this->image !== FALSE) {
|
if($this->image !== FALSE) {
|
||||||
$this->valid = true;
|
$this->valid = true;
|
||||||
|
@ -27,6 +27,10 @@ class photo_imagick extends photo_driver {
|
|||||||
function load($data, $type) {
|
function load($data, $type) {
|
||||||
$this->valid = false;
|
$this->valid = false;
|
||||||
$this->image = new Imagick();
|
$this->image = new Imagick();
|
||||||
|
|
||||||
|
if(! $data)
|
||||||
|
return;
|
||||||
|
|
||||||
$this->image->readImageBlob($data);
|
$this->image->readImageBlob($data);
|
||||||
|
|
||||||
|
|
||||||
@ -71,9 +75,9 @@ class photo_imagick extends photo_driver {
|
|||||||
if((! $quality) || ($quality > 100))
|
if((! $quality) || ($quality > 100))
|
||||||
$quality = JPEG_QUALITY;
|
$quality = JPEG_QUALITY;
|
||||||
$this->image->setCompressionQuality($quality);
|
$this->image->setCompressionQuality($quality);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user