| | |
PHP image resize issue.
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2005
Posts: 92
Reputation:
Solved Threads: 0
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.
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:
[php]
imagejpeg($second,$v_thumbnailfile,$def_quality);
[/php]
hope this helps.
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.
![]() |
Similar Threads
- Image Resize (Graphics and Multimedia)
- Mysql Php Image Help Please!!! (MySQL)
- need help with php scripts (PHP)
- Image Resize Function Error (PHP)
- php image resize quality (PHP)
- Image Pasting Issue in Microsoft Word 2003 (Windows Software)
- PHP image swapping ? (PHP)
Other Threads in the PHP Forum
- Previous Thread: Newb PHP question
- Next Thread: PHP Screen Scraping
| Thread Tools | Search this Thread |
5.2.10 action apache api array basic beginner binary broken cakephp checkbox class classes cms code computing confirm cron curl database date delete destroy display domain dynamic echo echo$_get[x]changingitintovariable... email error fatalerror file files folder form forms function functions google header href htaccess html iframe image include indentedsubcategory insert ip javascript joomla limit link load local login mail malfunction menu mlm mod_rewrite multiple mysql mysqlquery neutrality oop paypal pdf php query radio random record reference remote return script search server sessions sockets source space sql syntax system table thesishelp tutorial unset update upload url validation validator variable video web window.onbeforeunload=closeme; youtube





