Creating thumbnails in 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
vivekjain
Forum Commoner
Posts: 76
Joined: Thu Jan 08, 2004 12:38 am

Creating thumbnails in PHP

Post by vivekjain »

Hi,
I am using PHP and the GD2 library, to create thumbnails of the images that have been uploaded. Actually, I need to have 2 images, one is the thumbnail and the other a larger image, so how do I go about this?
I am uploading 5 images and uploading it to a folder, when uploading I am resizing it to say 550 px. Now I want to create a thumbnail as well, how do I?

Thanks

Regards,
Vivek
User avatar
aerodromoi
Forum Contributor
Posts: 230
Joined: Sun May 07, 2006 5:21 am

Re: Creating thumbnails in PHP

Post by aerodromoi »

vivekjain wrote:Hi,
I am using PHP and the GD2 library, to create thumbnails of the images that have been uploaded. Actually, I need to have 2 images, one is the thumbnail and the other a larger image, so how do I go about this?
I am uploading 5 images and uploading it to a folder, when uploading I am resizing it to say 550 px. Now I want to create a thumbnail as well, how do I?

Thanks

Regards,
Vivek
Since you're already using a php script to resize the images, why don't you put the gd part into a function,
thus allowing you to specify the name of the resized image and its size. Or did I get something wrong?

aerodromoi
vivekjain
Forum Commoner
Posts: 76
Joined: Thu Jan 08, 2004 12:38 am

PHP Thumbnails

Post by vivekjain »

Thanks for your response. I tried that, but it doesnt seem to be working.
Is there a way to achieve this, or some script that copies an image, resizes a copy of the image, and then resizes the original image?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Search the forums for thumbnailing. Others have had problems with it as well.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply