Alright ppl,
I'm tearing my hair out on this one...
I'm currently resizing a batch of JPEG's (approx 100,000 @ 1024x768) down to GIF's (thumbnails). My hosting company currently has GD library 1.62 installed and I am able to convert between JPEG and GIF ok.
The problem is that the original Jpegs are around 20k-30k. If I use Fireworks, Photoshop etc and manually convert them the quality is great and they are around 1k. Using the function included below the quality is nowhere near as good and the average size is around 6k - a huge increase when you consider that this applies to 100,000 images.
function sizeImage($src, $dest, $w, $h) {
$attr = getimagesize($src);
$img_src = imagecreatefromjpeg($src);
$img_dest = imagecreate($w,$h);
imagecopyresized($img_dest, $img_src, 0, 0, 0, 0, $w, $h, $attr[0], $attr[1]);
imagegif($img_dest);//, $dest);
imagedestroy($img_dst);
}
Any help would be greatly appreciated.
Cheers,
Paul