How can we create Thumbnail image by PHP?

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
Mds
Forum Contributor
Posts: 110
Joined: Tue Apr 22, 2008 8:56 pm
Contact:

How can we create Thumbnail image by PHP?

Post by Mds »

Hi there.
How can we create Thumbnail image by PHP?

Can you help me ?
manixrock
Forum Commoner
Posts: 45
Joined: Sun Jul 20, 2008 6:38 pm

Re: How can we create Thumbnail image by PHP?

Post by manixrock »

You can use http://php.net/imagecreatefromjpeg (or what other php supported format you need) to open the original image as an object, create the thumbnail image object using http://php.net/imagecreatetruecolor, resize/copy it from the original to the thumbnail one with http://php.net/imagecopyresampled, the save it with http://php.net/imagejpeg.
User avatar
Mds
Forum Contributor
Posts: 110
Joined: Tue Apr 22, 2008 8:56 pm
Contact:

Re: How can we create Thumbnail image by PHP?

Post by Mds »

Greatest answer.
Thank you my friend.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: How can we create Thumbnail image by PHP?

Post by pickle »

Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply