I need to resize image pic.jpg to different image(pict.jpg)..
but I get:
Warning: imagejpeg: unable to open 'pict.jpg' for writing in /usr/local/www/vhosts/all4-u.net/htdocs/gd.php on line 10
why doesnt it work?
<?
$image_file_path="pic.jpg";
$pic="pict.jpg";
$img = ImageCreateFromJPEG($image_file_path );
$FullImage_width = imagesx($img);
$FullImage_height = imagesy($img);
$full_id = ImageCreate(100,100);
ImageCopyResized( $full_id, $img,0,0,0,0,100,100,$FullImage_width, $FullImage_height);
ImageJPEG($full_id,$pic);
ImageDestroy($full_id);
?>
What makes me mad is the faxt that followinf works just fine:
<?
Header( "Content-type: image/jpeg");
$image_file_path="pic.jpg";
$pic="pict.jpg";
$img = ImageCreateFromJPEG($image_file_path );
$FullImage_width = imagesx($img);
$FullImage_height = imagesy($img);
$full_id = ImageCreate(100,100);
ImageCopyResized( $full_id, $img,0,0,0,0,100,100,$FullImage_width, $FullImage_height);
ImageJPEG($full_id);
ImageDestroy($full_id);
?>
Why????