| | |
php image resize quality
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 use PHP GD library to resize image to thumbnail size, however I found the small converted image has bad quality(distorted color), how can I improve the image quality by using PHP GD library:
Thanks for any response.
PHP Syntax (Toggle Plain Text)
$first=imagecreatefromjpeg($uploadfile); define(MAX_WIDTH, 180); define(MAX_HEIGHT, 135); $width = imagesx($first); $height = imagesy($first); $scale = min(MAX_WIDTH/$width, MAX_HEIGHT/$height); $new_width = floor($scale*$width); $new_height = floor($scale*$height); $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
- Image Resize (Graphics and Multimedia)
- Mysql Php Image Help Please!!! (MySQL)
- Image Resize Function Error (PHP)
- PHP image resize issue. (PHP)
- Python and the JPEG Image File, Part 2, The Image (Python)
- Python and the JPEG Image File, Part 1, The Header (Python)
- PHP image swapping ? (PHP)
Other Threads in the PHP Forum
- Previous Thread: Associative Array of States and Countries
- Next Thread: autogenerated mysql query with javascript
| Thread Tools | Search this Thread |
apache api array basic beginner binary body broken cakephp class cms code computing confirm cron curl customizableitems database date date/time delete display dynamic echo email error file files filter folder form forms forum function functions gc_maxlifetime global google headmethod href htaccess html iframe image include ip javascript joomla limit link list login malfunction memmory memory menu mlm msqli_multi_query multiple mycodeisbad mysql navigation oop parameter parsing paypal pdf php phpmysql query question random recourse recursion regex script search select seo server sessions snippet source space sql static system table thesishelp trouble tutorial update upload url variable video web webdesign xml youtube





