I have this function:
Code: Select all
function createThumbnail($image_path, $image_id, $file, $width, $height, $compression) {
copy($file, "$image_path/$image_id");
$src_img = imagecreatefromJPEG("$image_path/$image_id");
$new_h = $height;
$new_w = $width;
$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, "$image_path/$image_id", $compression);
}Any suggestions what I can do to fix it?
Thanks,
Peter.