mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-01 22:00:31 +02:00
Verbose error when failing to open image
This commit is contained in:
@@ -809,14 +809,18 @@ class CImage
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
$this->image = imagecreatefromjpeg($this->pathToImage);
|
||||
$this->image or die("Fatal error when opening image.");
|
||||
break;
|
||||
|
||||
case 'gif':
|
||||
$this->image = imagecreatefromgif($this->pathToImage);
|
||||
$this->image or die("Fatal error when opening image.");
|
||||
break;
|
||||
|
||||
case 'png':
|
||||
$this->image = imagecreatefrompng($this->pathToImage);
|
||||
$this->image or die("Fatal error when opening image.");
|
||||
|
||||
$type = $this->getPngType();
|
||||
$hasFewColors = imagecolorstotal($this->image);
|
||||
|
||||
|
@@ -133,6 +133,7 @@ Revision history
|
||||
|
||||
v0.5.x (latest)
|
||||
|
||||
* Removed @ from opening images, better to display correct warning when failing #34.
|
||||
* Setting gd.jpeg_ignore_warning to true as default #34.
|
||||
* `webroot/check_system.php` now outputs version of PHP and GD.
|
||||
* #32 correctly send 404 header when serving an error message.
|
||||
|
Reference in New Issue
Block a user