How to crop an image while uploading?
I am doing an social networking project ,where i have an option to add/edit photos ,When user clicks the button the image will be uploaded to the database and it will be updated...is it possible to crop the image before it is saved to the database. simply call this function ..with param source ,destination and size what u want :) function cropImage($source,$dest,$whsize) { $size = getimagesize($source); $w = $size[0]; $h = $size[1]; $xratio=$w/$whsize; $yratio=$h/$whsize; if($xratio > $yratio)$multiplier=$xratio; else $multiplier=$yratio; $nw=$w/$multiplier; $nh=$h/$multiplier; switch($size[2]