1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-07-24 18:21:48 +02:00

improving error handling when opening (non)-recoverable images

This commit is contained in:
Mikael Roos
2014-08-21 02:22:20 +02:00
parent 1a6cef6580
commit fb261b1b05

View File

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