Image thumbnail creator help!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Image thumbnail creator help!

Post by social_experiment »

prionkor wrote:How can i improve the quality of the thumbnail image?
'imagejpeg()' accepts an optional argument for quality. The default is 75. Try the following :

Code: Select all

<?php
imagejpeg( $tmp_img, "admin/images/uploads/thumbs/image_001.jpg", 100 ); ?>
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Image thumbnail creator help!

Post by pickle »

Also, use imagecopyresampled() instead of imagecopyresized(). imagecopyresized() doesn't interpolate, which results in stark colour changes.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Image thumbnail creator help!

Post by pickle »

Which one are you considering to be "first"?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply