Thanks for reply. I have applied the code to both gd1 and gd1, checked and double checked. logged out and in to coppermine afterwards and still the same issue. Do I miss something?
Here is the code I have amended :
case "gd1" :
if (!function_exists('imagecreatefromjpeg')) {
cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed', __FILE__, __LINE__);
}
if ($imginfo[2] == GIS_JPG)
$src_img = imagecreatefromjpeg($src_file);
else
$src_img = imagecreatefrompng($src_file);
if (!$src_img) {
$ERROR = $lang_errors['invalid_image'];
return false;
}
$dst_img = imagecreate($destWidth, $destHeight);
imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $srcWidth, $srcHeight);
$fh=fopen($dest_file,'w');
fclose($fh);
imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);
imagedestroy($src_img);
imagedestroy($dst_img);
break;
case "gd2" :
if (!function_exists('imagecreatefromjpeg')) {
cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed', __FILE__, __LINE__);
}
if (!function_exists('imagecreatetruecolor')) {
cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the admin page', __FILE__, __LINE__);
}
if ($imginfo[2] == GIS_GIF && $CONFIG['GIF_support'] == 1)
$src_img = imagecreatefromgif($src_file);
elseif ($imginfo[2] == GIS_JPG)
$src_img = imagecreatefromjpeg($src_file);
else
$src_img = imagecreatefrompng($src_file);
if (!$src_img) {
$ERROR = $lang_errors['invalid_image'];
return false;
}
if ($imginfo[2] == GIS_GIF)
$dst_img = imagecreate($destWidth, $destHeight);
else
$dst_img = imagecreatetruecolor($destWidth, $destHeight);
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $srcWidth, $srcHeight);
$fh=fopen($dest_file,'w');
fclose($fh);
imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);
imagedestroy($src_img);
imagedestroy($dst_img);
break;
}