PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Dec 05, 2019 7:18 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Mon Jul 12, 2004 8:10 pm 
Offline
Forum Commoner

Joined: Wed Jun 30, 2004 10:40 pm
Posts: 89
I am going to be putting together an image gallery for each of my clients in php. I am thinking I will store the large images in a folder called IMAGES and the thumbnails in a folder called THUMBNAILS. Then the php will load up the thumbnails on left of screen and when a thumbnail is clicked the larger image will show on right of screen.

Will this be hard to code in terms of errors? - example, user clicks image #1 thumbnail and image #3 shows on right of screen.

Or is there a way that you can have thumbnails generated as required by the user. Example, php makes thumbnails of larger images and then displays them.

Would appreciate any thoughts or experience in this matter.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 12, 2004 8:57 pm 
Offline
DevNet Resident

Joined: Tue Apr 23, 2002 10:02 am
Posts: 1199
Location: Brisbane
i always choose to make the thumbs when the image is uploaded, it saves time and resources beacuse it wont be done over and over agian.

so, all you need to do is,

- allow upload of image
- workout a random string (for the filename)
- upload the image to IMAGES
- make a thumb of it with the same name, copy it to THUMBS

then just show images from THUMBS, but link to images in IMAGES folder, you can find sample code for all the above points in this forum by searching, good luck.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 12, 2004 10:55 pm 
Offline
Forum Commoner

Joined: Wed Jun 30, 2004 10:40 pm
Posts: 89


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 13, 2004 3:45 am 
Offline
Forum Contributor

Joined: Sat Mar 27, 2004 6:54 am
Posts: 194
Thought this might interest you

http://nstoia.com/testpg01/

Lite...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 19, 2004 12:21 pm 
Offline
Forum Newbie

Joined: Sun Sep 19, 2004 11:52 am
Posts: 2
Location: Marin Co. Ca
It's been a while, but here's how I did this. I too used "pictures" and "thumbnails" folders.

I drop a .jpg (or whatever) into the 'pictures" folder.

When someone visits the gallery, php reads the directory of the "pictures" folder and COMPARES it to the directory of the "thumbnails" folder.

If there is a picture without a correspoding thumbnail, GD takes the picture, copies and resizes the copy and deposits it into the "thumbnails" folder. That way the thumbnails are only generated ONCE and subsequent visits will not have to wait.

The same basic process works the other way around. ie: removing images from the gallery. Once per session I have the folders compared and if there is a thumbnail without it's larger sibling, it removes the thumbnail.

Hope that helps...

One of my current projects is to use this technique again but with the benefits of the new object model. If I get it going quickly enough, I'll append this post with a link.

As far as difficulty goes, I'd say it's of moderate difficulty. You'll need php's file system functions, and GD to do this right. Feel free to email me with questions. If I can help, I'd be glad to.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 27, 2007 7:49 am 
Offline
Forum Newbie

Joined: Fri Apr 27, 2007 3:23 am
Posts: 1
I think there is an option for this on that might be helpfull .


Last edited by mikejolly on Thu May 03, 2007 6:56 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 27, 2007 9:55 am 
Offline
Briney Mod
User avatar

Joined: Mon Jan 19, 2004 7:11 pm
Posts: 6446
Location: 53.01N x 112.48W

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group