Click to See Complete Forum and Search --> : clicking thumbnails to see larger image?
ss1289
01-08-2008, 11:13 PM
I can't find anything on this but I was wondering how to scale a large image into a thumbnail size image for an album. Then when a user clicks on the thumbnail the larger image is shown. Like how myspace has it on the pics feature for each profile.
Is there any way to do this without using two different image files (thumbnail and larger image file), but just use the larger image file and decrease the dimensions for the thumbnail?
Any help would be appreciated.
Thanks
ray326
01-08-2008, 11:15 PM
There is a way to do it with just the big image but don't. There's a good reason it's called "dumbnailing".
ss1289
01-08-2008, 11:21 PM
ok thanks, I've never heard that term.
spiresgate
01-09-2008, 07:10 AM
Ray326 hasn't been very helpful. Presumably he means it's a dumb thing to do as it will take just as long to load the 'small' image as the large one, negating one of the reasons for using thumbnails in a preliiminary view.
I don't know what the answer is but it must be possible to do what ss1289 wants because innumerable programs do this (Windows Explorer, for instance) without having to create the thumbnails yourself.
ss1289
01-09-2008, 03:14 PM
Ray326 hasn't been very helpful. Presumably he means it's a dumb thing to do as it will take just as long to load the 'small' image as the large one, negating one of the reasons for using thumbnails in a preliiminary view.
I don't know what the answer is but it must be possible to do what ss1289 wants because innumerable programs do this (Windows Explorer, for instance) without having to create the thumbnails yourself.
Well the reason I wanted to do it is so that user can upload the larger image and then my program will scale the larger image into a thumbnail for them to view. Then when the user clicks on it, it shows the larger image.
I basically don't want to have two different image file sizes in my system, just the larger image file.
blue-eye-labs
01-09-2008, 03:48 PM
The best way of doing it is to use a seperate thumbnail image because a) the quality doesn't get all pixelated when it is downsized by squashing it, and also because it will take ages to load a whole bunch of larger images instead of smaller thumbnail ones. Your audience isn't going to wait for the images to load, unless they are desperate to see them.
The best way is to use PHP to handle the images, resize/crop them and create a thumbnail/larger image...
The other way is very very simple, but I wouldn't recommend it.
ray326
01-09-2008, 11:42 PM
The only way to do what you want to do decently is to generate the thumbnail on the fly when it's needed. For that you'll need some good image processing code to run on your server. Two packages that come to mind are Image Magic and The GIMP.
By far the best practice is to create and use the separate thumbnail image, though.
The_Magus
01-10-2008, 07:46 AM
Further to the comment of Blue-eyed-lab:
I agree with the need to upload and use both a thumbnail and full image if for no other reason then I use a lot of 100 px thumbnails on my pages and it would take a year and a half if the viewer had to wait for all the full sized images to download.
By using the thumbnails the viewer can decide which larger images they want to view and wait for only those to down load. Yes, this system takes a lot more space on the server but what the heck, that's what they are there for.
It is very simple to make thumbnails if you are using Front Page, Web Expression or Dreamweaver - you have only to decide what size you want them to be.
Cheers and have a good day.
Jack
The Magus
spiresgate
01-10-2008, 09:18 AM
Thumbnails by their very nature are intended only to convey a rough idea of the parent picture and are small on the page anyway. 50kB size files should be adequate for this, so space on the server (compared with half a Meg for the parent) is not really an issue.
blue-eye-labs
01-10-2008, 12:21 PM
generating on the fly uses quite a bit of processing power, which will slow everything down. You can use a php script to create thumbnails of an uploaded image though, using the GD libs.
ray326
01-10-2008, 10:52 PM
Yes, but the OP has already established the non-functional specification that it must be done without using a separate physical thumbnail image. That leaves dumbnailing or demand generated thumbnails.
ss1289
01-11-2008, 01:11 AM
Thanks for the info.
I actually found a php class that automatically creates a thumbnail file when a user uploads an image.
blue-eye-labs
01-11-2008, 01:53 AM
Yes, but the OP has already established the non-functional specification that it must be done without using a separate physical thumbnail image. That leaves dumbnailing or demand generated thumbnails.
Thanks for the info.
I actually found a php class that automatically creates a thumbnail file when a user uploads an image.
I rest my case.
spiresgate
01-11-2008, 03:16 AM
Yes, but what's the point of creating a thumbnail AFTER the main imaage is uploaded?
blue-eye-labs
01-11-2008, 04:47 AM
so that the user only has to upload one image.
In my digital art portfolio I display quite a few images over everal pages which are loaded before hand, so when I upload an image my script does this:
file => full version copied => smaller "viewer" version created => thumbnail cropped and created.
That way loading times are minimised, as is processor load at runtime.