I'm using the following code to resize a jpeg,
function thumbjpg($image_path, $thumb_path, $image_name, $thumb_width)
{
$src_img = imagecreatefromjpeg("$image_path/$image_name");
$origw=imagesx($src_img);
$origh=imagesy($src_img);
$new_w = $thumb_width;
$diff=$origw/$new_w;
$new_h=$origh/$diff;
$dst_img = imagecreatetruecolor($new_w,$new_h);
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img));
imagejpeg($dst_img, "$thumb_path/$image_name");
return true;
}
If the extension is .jpg instead of .JPG then I get thrown a bunch of errors, using the same file with extension .JPG works fine. What's up with that?
Cheers