ImageMagick invalid image handling

This commit is contained in:
Savetheinternet 2011-07-22 19:53:22 +10:00
parent cf31555818
commit ecb42bcc6d

View File

@ -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);