Okay, I have been working on this all day and cannot figure it out... I'm trying to save an image that is passed on by a form, then resizing it and saving a smaller thumbnail of it. I can save the original image, but when I try to resize it and save it, it does not work... Below my script, can anyone help?
//START
//$pPhoto passed to this function as a file from upload form.
$path = "images/photo.jpg";
$thm_path = "images/photo_thm.jpg";
//This works and saves the file
if (!@copy($pPhoto, $path))
print "Fail";
//Resize and create thumbnail
$source = imagecreatefromjpeg($pPhoto);
$dest = imagecreate(200, 100);
imagecopyresized($dest, $source,0,0,0,0,100,100,200,200);
//I tried this and it fails...
if (!ImageJPEG($dest, $thm_path, 90))
print "Fail";
//I also tried this and it fails...
if (!@copy($pPhoto, $thm_path))
print "Fail";
//END