if(!getimagesize($file_path)) error_log('yep, image '.$file_path.' looks corrupt');
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
in system/library/image.php you have:
Code: Select all
if (file_exists($file)) {
$this->file = $file;
$info = getimagesize($file);
$this->width = $info[0];
$this->height = $info[1];
$this->bits = isset($info['bits']) ? $info['bits'] : '';
$this->mime = isset($info['mime']) ? $info['mime'] : '';
if ($this->mime == 'image/gif') {
$this->image = imagecreatefromgif($file);
} elseif ($this->mime == 'image/png') {
$this->image = imagecreatefrompng($file);
} elseif ($this->mime == 'image/jpeg') {
$this->image = imagecreatefromjpeg($file);
}
} else {
exit('Error: Could not load image ' . $file . '!');
}
you could make that:
Code: Select all
if (file_exists($file)) {
$this->file = $file;
$info = getimagesize($file);
// image corrupt check
if (!$info) error_log('cannot obtain image info for '.$file);
$this->width = $info[0];
$this->height = $info[1];
$this->bits = isset($info['bits']) ? $info['bits'] : '';
$this->mime = isset($info['mime']) ? $info['mime'] : '';
if ($this->mime == 'image/gif') {
$this->image = imagecreatefromgif($file);
} elseif ($this->mime == 'image/png') {
$this->image = imagecreatefrompng($file);
} elseif ($this->mime == 'image/jpeg') {
$this->image = imagecreatefromjpeg($file);
}
// image corrupt check
if (!$this->image) error_log('cannot create image '.$file);
} else {
exit('Error: Could not load image ' . $file . '!');
}
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Code: Select all
exit('Error: PHP GD is not installed!');
Code: Select all
error_log('Error: PHP GD is not installed!');
Code: Select all
exit('Error: Could not load image ' . $file . '!');
Code: Select all
error_log('Error: Could not load image ' . $file . '!');
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Users browsing this forum: Bing [Bot], daniil_oc, drag84, WaxedPerfection and 471 guests