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