I know it says imagecopyresized but, whenever I use it, it crops the picture instead (but atleast the size comes out right!). I'd appreciate it if anyone can tell me what I'm doing wrong here. If it's supposed to crop, what should I use to resize. (I should note that GD is my only option, so using ImageMagick is out of the question)
Here's my code:
function create_thumbnail($image_path,$thumb_path,$image_name) {
$src_img = imagecreatefromjpeg("$image_path/$image_name");
$origw = imagesx($src_img);
$origh = imagesy($src_img);
$new_w = intval($origw * 0.25);
$new_h = intval($origh * 0.25);
$dst_img = imagecreate($new_w,$new_h);
imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img));
imagejpeg($dst_img, "$thumb_path/$image_name");
imagedestroy($src_img);
return true;
}
TIA