// this is the code that does the resizing
ini_set('memory_limit', '2048M');
$img = file_get_contents(UPLDPATH.$path);
$img = imagecreatefromstring($img);
imagesavealpha($img, true);
$background = imagecolorallocate($img, 0, 0, 0);
imagecolortransparent($img, $background);
imagealphablending($img, false);
$new_img = imageCreateTransparent(1000);
imagecopyresampled($new_img, $img, 0, 0, ($gt=='width'?0:($$gt-$$st)/2), ($gt=='height'?0:($$gt-$$st)/2), 100, 100, $width, $height);
imagePng($img,UPLDPATH.$path,9);