From 2643d4954fd15c5f315f64d8005b936d709c58b8 Mon Sep 17 00:00:00 2001 From: Mikael Roos Date: Thu, 21 Aug 2014 02:13:01 +0200 Subject: [PATCH] must have @ before open images, warning contra notice, recoverable and non recoverable --- CImage.php | 6 +++--- README.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CImage.php b/CImage.php index c9897f6..4877942 100644 --- a/CImage.php +++ b/CImage.php @@ -808,17 +808,17 @@ class CImage switch ($this->fileExtension) { case 'jpg': case 'jpeg': - $this->image = imagecreatefromjpeg($this->pathToImage); + $this->image = @imagecreatefromjpeg($this->pathToImage); $this->image or die("Fatal error when opening image."); break; case 'gif': - $this->image = imagecreatefromgif($this->pathToImage); + $this->image = @imagecreatefromgif($this->pathToImage); $this->image or die("Fatal error when opening image."); break; case 'png': - $this->image = imagecreatefrompng($this->pathToImage); + $this->image = @imagecreatefrompng($this->pathToImage); $this->image or die("Fatal error when opening image."); $type = $this->getPngType(); diff --git a/README.md b/README.md index 989c72b..8955cb4 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ Revision history v0.5.x (latest) -* Removed @ from opening images, better to display correct warning when failing #34. +* Removed @ from opening images, better to display correct warning when failing #34, but put it back again. * 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.