Let me just start off by saying that I am in no way a javascript wizard. I'm even hesitant to call myself a developer of any kind as most of the "development" work I've done has been of the hack'n'slash type. For the most part I can get something started, or hack something existing to work the way I want it to.
This post isn't about my ineptitude as a developer though, but rather about the discoveries I made while investigating jQuery based plugins to do some photography presentations on the photo365.org site I recently hacked together.
All Lightbox inspired solutions were automatically disqualified, at least in the long run, as thats been overdone basically everywhere by now. I do use a Thickbox on the site right now though, but thats not the solution I really want to stick with in the end. Consider it a placeholder for now.
After looking for pre-made plugins that could help the site display the photos, I was left with a list of potential candidates:
All of these, besides Galleriffic have one major flaw, at least how I see it. They all download the full size image you wanto to display and then resize them in browser. Not only is this slow, but it's a huge bandwidth eater. Trent Foley’s Galleriffic however, does this a bit differently. Like all the others, it's based on an unordered list that holds your images, but instead of just doing a simple html img off the fulle size image, it implements a way to show a specific thumbnail that links to the full image you want to display. You can even link to the original image for download purposes if you want.
In my particular case, where I on each of the participating photographers "profile page" will end up with showing a total of 365 images on a single page, the bandwidth waste is very obvious.
To break it down, we end up with some number similar to this (Based on 1 random image from the pool):
- Full Size: 54993 bytes
- Thumbnail Size: 6165 bytes
Now, if you add all of this up you will end up with a calculation that is something like this:
- Resize in browser total image size:
365 images x 54993 bytes = 20072445 bytes = 19.14 Megabytes - Separate thumb and full size display:
(1 x 54993 bytes) + (364 images x 6165 bytes) = 2299053 bytes = 2.19 Megabytes
This equals an approximate difference of 17 Megabytes transferred on each page request that this particular profile page gets. I could of course split my profile pages into smaller chunks and help relieve some of the bandwidth usage per page load that way, but my I want to display all of the thumbnails all at once.
As I said, I'm no javascript wizard and I'm sure there are good reasons why most of these plugins behave the way they do. Grabbing the full image and then resize it "locally" seems to be the easy way to implement something like this and I guess easy is what we are all looking for. Doing this does make the html markup very easy, and if you don't have thumbnails readily available in your setup it's fine. In my case, I do have thumbnails and I want to utilize them properly.
Did I miss some great jQuery based photo showoff plugin that I should have looked at? I'm sure there are several that consider the needs of bandwidth concious users out there, and that I've just missed them. If that is the case, please let me know.
Now I'm off to try and actually get Galleriffic integrated into my photo365 project site.
4 Comments so far
miro, on January 29, 2009 at 2:27pm, said:
Hi!
Let me answer your question. Most of javascript galleries aren't designed to display 365 images in the most efficient way. At these volumes it is logical that vast majority of your visitors will not click on every image to see it full screen. My gallery was designed to show 5-10 images of medium size - those go around 60 - 100 kB that means that you will load max 1MB of images.
At this constellation it is relatively fast, really easy to implement, no thumbs are needed and it degrades gracefully for browsers that do not have javascript turned on, you see all images in full size.
Intended audience is e.g a company that wants to present its services in an user friendly way - for them 5 - 10 images are ideal and it is likely that customers will click around to see most of these images.
Another important aspect is that, once loaded, gallery does not consume any HTTP requests to load full screen images as they are already loaded.
That is why...
Edit Comment
Christian Mohn (h0bbel), on January 29, 2009 at 2:32pm, said:
@Miro: I can understand that, but what I don't understand is why almost all of these "Gallery Plugins" doesn't allow you to utilize a thumbnail if you have it available?
Surely it would be fairly easy to implement?
Edit Comment
Anonymous, on March 31, 2009 at 7:04pm, said:
...index.html">Galleriffic is a dynamic photo gallery optimized to handle a high volume of photos. h0bbel has posted a ...
Edit Comment
Galleriffic 2.0 « trentacular, on October 26, 2009 at 5:06pm, said:
... is a jQuery photo gallery optimized to handle high volumes of photos while conserving bandwidth. h0bbel has posted a ...
Edit Comment