ImageMagick invalid image handling
This commit is contained in:
1 parent
cf31555818
commit
ecb42bcc6d
1 file changed
+5
@@ -142,7 +142,12 @@
|
||||
$this->image = new Imagick();
|
||||
}
|
||||
public function from() {
|
||||
try {
|
||||
$this->image->readImage($this->src);
|
||||
} catch(ImagickException $e) {
|
||||
// invalid image
|
||||
$this->image = false;
|
||||
}
|
||||
}
|
||||
public function to($src) {
|
||||
$this->image->writeImage($src);
|
||||
|
||||
Reference in new issue
Block a user