Do I need to output the file? I am just looking to save it into the thumbnail directory. I placed the imagejpg into the script as such:
if (@$file) {
//declare var for photo file name for db
$photo_file = $file['name'];
//sql
$query = " INSERT into photos (photo_file, photo_date, photo_desc)
VALUES ('$photo_file', '$date', '$desc')";
$result = mysql_query($query, $conn) or die(mysql_error());
//path name vars
$abspath = $HTTP_SERVER_VARS['PATH_TRANSLATED'];
$stub=ereg_replace("/photoAdd.php","/",$abspath);
// use $fullname for the resulting path for file uploads, based on any changes you make above
$fullname = $stub ."/images/photos/".$file['name'];
$fullNameThumb = $stub ."/images/photos/thumbs/".$file['name'];
//copies full sized image
copy($file['tmp_name'],$fullname);
//begin thumbnail script
$src_img=imagecreatefromjpeg($fullname);
$old_x=imagesx($src_img);
$old_y=imagesy($src_img);
$thumb_w=100;
$thumb_h=100;
$dst_img = imagecreatetruecolor($thumb_w,$thumb_h);
//echo $src_img;
imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);
imagejpeg($dst_img,"",90);
//copy($dst_img,$fullNameThumb);
imagedestroy($dst_img);
imagedestroy($src_img);
header("Location:photoAdmin.php");
}
Now the thumb is being generated but not saved resized. Also the header line is being ignored and the page simply shows the thumb when submitted.
I'm at a loss,
Thanks for all your help,
1M.