Asperon Posted September 4, 2007 Share Posted September 4, 2007 if I have $im = createimagefrompng($file); how do I resize $im?? Quote Link to comment https://forums.phpfreaks.com/topic/67942-solved-how-to-resize-images-in-gd-similar-to-another-post-but-different-question/ Share on other sites More sharing options...
jvrothjr Posted September 4, 2007 Share Posted September 4, 2007 thumb_jpeg($form_data_name,$upload_dir,$thumbnail_path); function thumb_jpeg($image_name,$source_path,$destination_path){ //Create Thumbnail $new_width=150; //Image width Change if needed $new_height=150; //Image height Change if needed $destimg=ImageCreate($new_width,$new_height) or die("Problem In Creating image"); $srcimg=ImageCreateFromjpeg($source_path.$image_name) or die("Problem In opening Source Image"); ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing"); Imagejpeg($destimg,$destination_path.$image_name) or die("Problem In saving"); } Quote Link to comment https://forums.phpfreaks.com/topic/67942-solved-how-to-resize-images-in-gd-similar-to-another-post-but-different-question/#findComment-341483 Share on other sites More sharing options...
Asperon Posted September 4, 2007 Author Share Posted September 4, 2007 thank you Quote Link to comment https://forums.phpfreaks.com/topic/67942-solved-how-to-resize-images-in-gd-similar-to-another-post-but-different-question/#findComment-341486 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.