diff options
-rw-r--r-- | include/photo/photo_gd.php | 3 | ||||
-rw-r--r-- | include/photo/photo_imagick.php | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/photo/photo_gd.php b/include/photo/photo_gd.php index a32bd2816..466f8c23a 100644 --- a/include/photo/photo_gd.php +++ b/include/photo/photo_gd.php @@ -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; diff --git a/include/photo/photo_imagick.php b/include/photo/photo_imagick.php index 7282898b4..2737c8f69 100644 --- a/include/photo/photo_imagick.php +++ b/include/photo/photo_imagick.php @@ -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; + } } } |