From e6f4ed47e2fa4c57665fc81c97165f6e4a4c2a5f Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 23 Mar 2021 20:01:32 +0000 Subject: [PATCH] Avoid error "Uncaught ImagickException: Unable to scale image" --- src/Object/Image.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Object/Image.php b/src/Object/Image.php index d69b01ad4..c1da711f9 100644 --- a/src/Object/Image.php +++ b/src/Object/Image.php @@ -541,7 +541,12 @@ class Image do { // FIXME - implement horizontal bias for scaling as in following GD functions // to allow very tall images to be constrained only horizontally. - $this->image->scaleImage($dest_width, $dest_height); + try { + $this->image->scaleImage($dest_width, $dest_height); + } catch (Exception $e) { + // Imagick couldn't use the data + return false; + } } while ($this->image->nextImage()); // These may not be necessary anymore