micheal... your posted code works perfectly assuming the GD2 library is in use... but just in case, here's how I would probably modify the code slightly...
$src_img = imagecreatefromjpeg("/path/to/$my_src_file");
$dst_img = imagecreatetruecolor($dest_width,$dest_height);
if(function_exists("imagecopyresampled"))
{
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $dest_width, $dest_height, $src_width, $src_height);
}
else
{
imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $dest_width, $dest_height, $src_width, $src_height);
}
imagejpeg($dst_img, "/path/to/storage/new_file.jpg", $quality);
imagedestroy($src_img);
imagedestroy($dst_img);
And, as an added note, imagecopyresampled is FAR superior to imagecopyresized, so if possible... make SURE your host / server supports it
As usual.. just my 2 cents 🙂