Hello,
I have a simple gallery that creates thumbnails from an image. Since my hosting provider upgraded it's version of GD, the colors of the thumbnail seem to be off:
http://www.vozz.ca/gallery/gallery2.php
like it's only displaying 256 colors or something? I had this simple script developed for me so I have no idea what functions I would need to place in my code, hopefully it's something simple. Any advice or suggestiuons as to how I can fix this would be appreciated.
I've posted the code below.
Thanks!
// make thumbnails
$image_path = "/home/vozz/public_html/gallery/galimages/gallery". $imgname . ".jpg";
$thumb_path = "/home/vozz/public_html/gallery/galimages/thumbnails/gallery". $imgname;
$src_img = imagecreatefromjpeg($image_path);
if (imagesx($src_img) > imagesy($src_img)) {
$resizeRatio = 100 / imagesx($src_img);
$new_w = 100;
$new_h = imagesy($src_img) * $resizeRatio;
$new_h = round($new_h);
} else {
$resizeRatio = 100 / imagesy($src_img);
$new_h = 100;
$new_w = imagesx($src_img) * $resizeRatio;
$new_w = round($new_w);
}
$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 . "_thumb.jpg");
echo "Image sucsessfully added<br><br>";
} else {
Echo "<b>You Must Select An Image to Upload</b>";
}
}