well here is the same thing iam sayin but its aint working its just resizing it to the small size and the 360 size is not workin its kept the same original size :S
PHP Code:
$destimg=ImageCreateTrueColor(360,240) or die('Problem In Creating image');
if($userfile_type=="image/gif")
$srcimg=ImageCreateFromgif($prod_img) or die('Problem In opening Source Image');
if($userfile_type=="image/pjpeg")
$srcimg=ImageCreateFromJPEG($prod_img) or die('Problem In opening Source Image');
imagecopyresampled($destimg,$srcimg,0,0,0,0,360,240,ImageSX($srcimg),ImageSY($srcimg)) or die('Problem In resizing');
ImageJPEG($destimg,$prod_img_thumb,90) or die('Problem In saving');
imagedestroy($destimg);
//------------------------------------
$maxwidth=120;
$new_height= 80;
$destimg=ImageCreateTrueColor($maxwidth,$new_height) or die('Problem In Creating image');
if($userfile_type=="image/gif")
$srcimg=ImageCreateFromgif($prod_img) or die('Problem In opening Source Image');
if($userfile_type=="image/pjpeg")
$srcimg=ImageCreateFromJPEG($prod_img) or die('Problem In opening Source Image');
imagecopyresampled($destimg,$srcimg,0,0,0,0,$maxwidth,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die('Problem In resizing');
ImageJPEG($destimg,$prod_img_thumb,90) or die('Problem In saving');
imagedestroy($destimg);
$query=" INSERT INTO IMAGE (ID,Items_ID,image_type,image_size,image_name,thumb_name,image_date) VALUES ('','".$_SESSION['items_id']."','$userfile_type','$userfile_size','$userfile_name','$thumb_name','$time_in')";
mysql_query($query) or die('Error !!'.mysql_error());
}
Bookmarks