From fb261b1b05fa31771bddab1a9807e00a07a823bc Mon Sep 17 00:00:00 2001 From: Mikael Roos Date: Thu, 21 Aug 2014 02:22:20 +0200 Subject: [PATCH] improving error handling when opening (non)-recoverable images --- CImage.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CImage.php b/CImage.php index 9db9536..7807f6d 100644 --- a/CImage.php +++ b/CImage.php @@ -840,17 +840,17 @@ class CImage case 'jpg': case 'jpeg': $this->image = @imagecreatefromjpeg($this->pathToImage); - $this->image or failedToLoad(); + $this->image or $this->failedToLoad(); break; case 'gif': $this->image = @imagecreatefromgif($this->pathToImage); - $this->image or failedToLoad(); + $this->image or $this->failedToLoad(); break; case 'png': $this->image = @imagecreatefrompng($this->pathToImage); - $this->image or failedToLoad(); + $this->image or $this->failedToLoad(); $type = $this->getPngType(); $hasFewColors = imagecolorstotal($this->image);