PHP image resize issue.

Reply

Join Date: Jun 2005
Posts: 92
Reputation: michael123 is an unknown quantity at this point 
Solved Threads: 0
michael123 michael123 is offline Offline
Junior Poster in Training

PHP image resize issue.

 
0
  #1
Oct 31st, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 48
Reputation: RamiroS is an unknown quantity at this point 
Solved Threads: 0
RamiroS's Avatar
RamiroS RamiroS is offline Offline
Light Poster

Re: PHP image resize issue.

 
0
  #2
Oct 31st, 2005
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC