grandgefx Posted January 24, 2012 Share Posted January 24, 2012 I want to resize both width and height of the thumb pic this is the php code <?php $id_member=$_SESSION['rid']; if(!empty($foto1_name)) { $nama_file=$foto1_name; $anton->sekur_upload($nama_file); if($valid) { $abpath = "conf/i/"; @copy($foto1, $abpath."/".$foto1_name); $abang_dom=$abpath."/".$foto1_name; list($width, $height) = getimagesize($abang_dom); if($width>200) { make_thumb("$abpath/$foto1_name","conf/i/thumb/$foto1_name",200); } else { $tujuan="conf/i/thumb/".$foto1_name; rename($abang_dom, $tujuan); } } $foto_old_name=$foto1_name; $foto1_name=$id_member."_".$foto1_name; $foto1_name=strtolower($foto1_name); $foto1_name=str_replace(' ', '', $foto1_name); $asal1="conf/i/".$foto_old_name; $asal2="conf/i/thumb/".$foto_old_name; $tujuan1="conf/i/".$foto1_name; $tujuan2="conf/i/thumb/".$foto1_name; rename($asal1, $tujuan1); rename($asal2, $tujuan2); } I want to set the size to 100 x 100, which part of the code that I need to edit? Quote Link to comment https://forums.phpfreaks.com/topic/255654-resize-the-thumbnail-pic/ Share on other sites More sharing options...
litebearer Posted January 24, 2012 Share Posted January 24, 2012 Unless you are starting with a square image, resizing BOTH height & width to 100, will result in a distorted image. You will most likely, need to CROP to a square then resize. cropping ... http://www.nstoia.com/sat/crop/ resizing ... http://www.nstoia.com/sat/resize/ Quote Link to comment https://forums.phpfreaks.com/topic/255654-resize-the-thumbnail-pic/#findComment-1310542 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.