944,184 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 9314
  • PHP RSS
Oct 31st, 2005
0

PHP image resize issue.

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
michael123 is offline Offline
93 posts
since Jun 2005
Oct 31st, 2005
0

Re: PHP image resize issue.

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:
[php]
imagejpeg($second,$v_thumbnailfile,$def_quality);
[/php]

hope this helps.
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
RamiroS is offline Offline
57 posts
since Mar 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Newb PHP question
Next Thread in PHP Forum Timeline: PHP Screen Scraping





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC