User is uploading an image of any reasonable size.
GD resamples it to a max 600 width and a max 250 height, however, the new image is 50k - which is too big.
It was originally 300DPI, but I don't know if that resample affects that or not. I don't want to lose a "decent" quality of the image, but I want to make sure it's not more than 72 DPI and no more than about 10, regardless the original size.
How can I do this?
Here's the code I'm using:
$image_rsz = imagecreatetruecolor($target_wd, $target_ht);
$image = imagecreatefromjpeg($UploadName);
imagecopyresampled($image_rsz, $image, 0, 0, 0, 0, $target_wd, $target_ht,
$orig_wd, $orig_ht);
imagejpeg($image_rsz, $UploadName);
Thanks!