i am using a script that i found on hotscripts to upload and resize images into thumbnails. My problem is, it will upload the initial image properly, and will create the second file that is supposed to be the thumbnail image, but the second image is empty. i can click on the .jpg file and everything, but there is no content inside the file. Here part of the script,
//##################### copy jpg pic to server ###############################
$dest="/matt/image/".$insid."img".$i.".jpg";
If (move_uploaded_file($$xpic, $dest))
{$log.=""; $piccount+=1;}
else
{$log.="$dest upload error!($$xpic)<br>";}
//######## make thumbnail from uploaded pic using GD2 lib functions ##########
$scale_ratio=2; //### Thumbnail scale ratio
$quality=90; //### Thumbnail quality
$dest_w=$big_w$scale_ratio;
$dest_h=$big_h$scale_ratio;
$src_w=$big_w;
$src_h=$big_h;
$dest_jpgx="/matt/image/".$insid."img".$i.".jpg";
$dest_t="/matt/image/".$insid."thm".$i.".jpg";
$in_jpg = imagecreatefromjpeg($dest_jpgx);
$out_jpg = imagecreate($dest_w,$dest_h);
imagecopyresized($out_jpg,$in_jpg,0,0,0,0,$dest_w,$dest_h,$src_w,$src_h);
imagejpeg($out_jpg,$dest_t,$quality); //### save this thumb to hard/server
imagedestroy($in_jpg);
imagedestroy($out_jpg);
//################### end make thumb from uploaded pic #######################
imagejpeg is working properly to create the jpeg, but imagecopyresized isn't resizing anything. I've messed with it for house, please help. Thanks