1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-07-31 13:40:08 +02:00

changing error handling to dir when failing to open a corrupt image

This commit is contained in:
Mikael Roos
2014-08-21 02:02:50 +02:00
parent ed9949b717
commit 28cda0ea28
3 changed files with 7 additions and 8 deletions

View File

@@ -808,15 +808,15 @@ class CImage
switch ($this->fileExtension) {
case 'jpg':
case 'jpeg':
$this->image = @imagecreatefromjpeg($this->pathToImage);
$this->image = imagecreatefromjpeg($this->pathToImage);
break;
case 'gif':
$this->image = @imagecreatefromgif($this->pathToImage);
$this->image = imagecreatefromgif($this->pathToImage);
break;
case 'png':
$this->image = @imagecreatefrompng($this->pathToImage);
$this->image = imagecreatefrompng($this->pathToImage);
$type = $this->getPngType();
$hasFewColors = imagecolorstotal($this->image);

1
cache/README.md vendored
View File

@@ -1 +0,0 @@
This directory must be writable by the webserver.

View File

@@ -103,6 +103,6 @@ return array(
ini_set('display_errors', 1); // Display all errors
ini_set('output_buffering', 0); // Do not buffer outputs, write directly
set_time_limit(20);
ini_set('gd.jpeg_ignore_warning', 1); // Ignore warning of corrupt jpegs
ini_set('gd.jpeg_ignore_warning', 0); // Ignore warning of corrupt jpegs
},
);