diff options
| author | Savetheinternet <savetheinternet@tinyboard.org> | 2011-07-22 19:53:22 +1000 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@tinyboard.org> | 2011-07-22 19:53:22 +1000 |
| commit | ecb42bcc6d1b36d72d17854d2ac68523b72a590d (patch) | |
| tree | 710a11120d6ca254f23583c260bb4b2cff572458 | |
| parent | cf315558183614bb54c1729c7ce7b8fd696704ac (diff) | |
ImageMagick invalid image handling
| -rw-r--r-- | inc/image.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/inc/image.php b/inc/image.php index d6ad9a07..b4226022 100644 --- a/inc/image.php +++ b/inc/image.php @@ -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); |
