I try to resize jpeg from photo size to thumbnails, however the thumbnails quality is bad, it looks fade and blur, I have no idea how to improve the quality of thumbnails.
PHP resize function:
-----
$first=imagecreatefromjpeg($uploadfile)
$second=imagecreate($new_width, $new_height);
imagecopyresized($second,$first,0,0,0,0,$new_width,$new_height,$width,$height);
imagejpeg($second,$v_thumbnailfile);
-----

Thanks for any response.

Check out http://cr.php.net/imagejpeg

Using imagejpeg the third parameter is the quality... use 75 or more to not loose all the quality...

You can also create a default value for your script... like $def_quality=82;

Then you'll do:

imagejpeg($second,$v_thumbnailfile,$def_quality);

hope this helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.