summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/image.php7
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);