mirror of
https://github.com/mosbth/cimage.git
synced 2025-01-17 19:18:15 +01:00
Verbose error when failing to open image
This commit is contained in:
parent
28cda0ea28
commit
ef1d56085a
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user