Forum Moderators: coopster
First thing to say, of course, is: does the directory /home/eqoagui/public_html/img/thumb/thumbs/ exist, and have you set its permissions properly (chmodding it to 777 should do it)? Maybe you chmodded a different directory previously, but this also needs to be chmodded 777 as well. Also, if 1.jpg in this directory already exists, it also needs to be chmodded 666 for this to work.
Another thing that comes to mind is the fact that this is a different path from some of the paths in errors reported in your previous postings. Maybe the paths created aren't corresponding to what's expected? Take a good look at the errors, if necessary echo out the paths at which you are trying to move or save things before you actually move or save them - this is a common source of errors in php.
$new_thumb = "$new_pic";
$sourcefile = "$uploaddir$new_pic";
$picsize = getimagesize("$sourcefile");
$source_x = $picsize[0];
$source_y = $picsize[1];
if ($source_x > $source_y){
$dest_x = 200;
$dest_y = 150;
} else {
$dest_x = 150;
$dest_y = 200;
}
$targetfile = "$uploaddir$new_pic";
$jpegqual = 75;
$source_id = imagecreatefromjpeg("$sourcefile");
$target_id = imagecreatetruecolor($dest_x, $dest_y);
$target_pic = imagecopyresized($target_id,$source_id,0,0,0,0,$dest_x,$dest_y,$source_x,$source_y);
imagejpeg($target_id,"$targetfile",$jpegqual);
?>
your uploaded pic seems to be here:
$sourcefile = "$uploaddir$new_pic";
as in the beginning of your code.
Later, in the last part, you then seem to overwrite this file by assigning the same file name:
$targetfile = "$uploaddir$new_pic";
Try using another file name for writing, e.g.
$targetfile = "$uploaddir$new_pic" . "_thumb";
Regards,
R.