summaryrefslogtreecommitdiffstats
path: root/system/libraries/Image_lib.php
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-12-09 16:25:31 +0100
committerDerek Jones <derek.jones@ellislab.com>2008-12-09 16:25:31 +0100
commit541ddbd6f3c0231f0e7fc0a18d9d54670a808958 (patch)
tree36dffaea51566829906e4cb322c1991742117a1c /system/libraries/Image_lib.php
parent4b6d493593b7400b7fa81d976fd3dc07ad30fe86 (diff)
added some better error checking for saving files with GD
Diffstat (limited to 'system/libraries/Image_lib.php')
-rw-r--r--system/libraries/Image_lib.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php
index 1b2d33de8..0e7f21435 100644
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -1195,7 +1195,11 @@ class CI_Image_lib {
return FALSE;
}
- @imagegif($resource, $this->full_dst_path);
+ if ( ! @imagegif($resource, $this->full_dst_path))
+ {
+ $this->set_error('imglib_save_failed');
+ return FALSE;
+ }
break;
case 2 :
if ( ! function_exists('imagejpeg'))
@@ -1209,7 +1213,11 @@ class CI_Image_lib {
@touch($this->full_dst_path); // PHP 4.4.1 bug #35060 - workaround
}
- @imagejpeg($resource, $this->full_dst_path, $this->quality);
+ if ( ! @imagejpeg($resource, $this->full_dst_path, $this->quality))
+ {
+ $this->set_error('imglib_save_failed');
+ return FALSE;
+ }
break;
case 3 :
if ( ! function_exists('imagepng'))
@@ -1218,7 +1226,11 @@ class CI_Image_lib {
return FALSE;
}
- @imagepng($resource, $this->full_dst_path);
+ if ( ! @imagepng($resource, $this->full_dst_path))
+ {
+ $this->set_error('imglib_save_failed');
+ return FALSE;
+ }
break;
default :
$this->set_error(array('imglib_unsupported_imagecreate'));