Resize & Crop Image with GD2 Lib.
/*Begin - Resize and Crop image with GD2*/
function exportimg($source, $target, $width, $height, $quality,$resize,$center){
$ext = strtolower(pathinfo($source, PATHINFO_EXTENSION));
list($width_orig, $height_orig) = getimagesize($source);