Hello,
I hope you can help me.
When I cancel the upload while uploading pictures, the uploadskript stops immediately (I think).
Thats a problem, because I calculate from the uploaded Picture 2 Thumnails. But when I cancel the upload, it could be happen that only one Thumbnail was created or no one. What cann I do, that the process end correctly.
Thank you,
greets Stefan
//Get first thumbnail (the single thumbnail in this code sample) and save it to disk.
$thumbnail1Field = "Thumbnail1_" . $i;
move_uploaded_file($_FILES[$thumbnail1Field]["tmp_name"],
$galleryPath . $path. "/" . $Gallery_id ."/". $fileName . "_n.jpg");
// Calculate
list ($w_new, $h_new) = CalculateImageSize($Width, $Height, 180, 120);
$imgh2 =ImageCreateFromJPEG($galleryPath . $path. "/" . $Gallery_id ."/". $fileName . "_n.jpg");
$imgsz = getimagesize($galleryPath . $path. "/" . $Gallery_id ."/". $fileName . "_n.jpg");
$imgh = imagecreatetruecolor($w_new,$h_new);
ImageCopyResampled($imgh, $imgh2, 0,0,0,0,$w_new,$h_new,$imgsz[0],$imgsz[1]);
imagejpeg($imgh,$galleryPath . $path. "/" . $Gallery_id ."/". $fileName . "_m.jpg",100);
imagedestroy ($imgh);
list ($w_new, $h_new) = CalculateImageSize($Width, $Height, 80, 70);
$imgh2 =ImageCreateFromJPEG($galleryPath . $path. "/" . $Gallery_id ."/". $fileName . "_m.jpg");
$imgsz = getimagesize($galleryPath . $path. "/" . $Gallery_id ."/". $fileName . "_m.jpg");
$imgh = imagecreatetruecolor($w_new,$h_new);
ImageCopyResampled($imgh, $imgh2, 0,0,0,0,$w_new,$h_new,$imgsz[0],$imgsz[1]);
imagejpeg($imgh,$galleryPath . $path. "/" . $Gallery_id ."/". $fileName . "_s.jpg",100);
imagedestroy ($imgh);