Flickr and Dojo Image Gallery

I have created an Image Gallery widget built on Dojo 0.4.3 that integrates nicely with Flickr. The widget it written entirely using JavaScript and CSS as a standalone Dojo widget, and is released under the same open source license as Dojo, the Academic Free License.

For more information, including the code and examples, see http://www.skynet.ie/~sos/ajax/imagegallery.php.

Some of the features of the widget include:

  • Pages of thumbnails.
  • Intelligent pre-loading of images so the images you are looking at are loaded first.
  • Fade effects for transitioning of images
  • Populated using JSON data – any JSON data, not just Flickr.
  • Flickr integration – remotely load your Flickr images.
  • Paging through a Flickr collection.
  • Slideshow

The widget can be instantiated from both HTML markup and programmatically in JavaScript.

To view your own Flickr pictures on the widget, without installing it on your own site, go to http://www.skynet.ie/~sos/ajax/yourpics.php .

There is a discussion thread in the Flickr API group at http://www.flickr.com/groups/api/discuss/72157600624623643.

So, why create this widget? Well, firstly I wanted a JavaScript image gallery that would list thumbnails and allow me to page through Flickr photos. Also, a slide show would have been nice. I was surprised to discover that I couldn’t find one that I liked in the twenty or so minutes I spent looking for one. I found a handy Flash based one, but I wanted a HTML and JavaScript only widget. So I grabbed Dojo 0.4.3 (my JavaScript library of choice right now) and wrote one.

Here is a screen shot:


Screenshot

The widget has all the features that I personally require at the moment, but will probably evolve as I think of new things to add. If you have any suggestions/bug reports, please comment on this post.

Share this post:digg it|kick it|Email it|bookmark it|reddit|liveIt

25 thoughts on “Flickr and Dojo Image Gallery

  1. Hello,

    it is possible to choose a flickr set or take the script only all pictures from my account?

    Thx,

    schumi

    p.s. Great Work!

  2. It’s not currently possible to choose a set, though I should be putting that in very soon.

    As for your second question, I presume you are referring to whether or not you can use your private pictures – unfortunately it only works with public pictures for now.

    Oh, and thanks šŸ™‚

    Shane

  3. Sure. The code is already separated into two widgets:
    – sos.widget.ImageGallery, which does all the basic stuff
    – sos.widget.FlickrImageGallery, which extends ImageGallery, and adds methods to work with the Flickr API, as well as paging. Mostly what it does is translate the Flickr data to the more simplistic data structure that the ImageGallery widget understands.

    So, for you to get it to work with Picasa web albums, copy what I did with the FlickrImageGallery widget, and modify it where necessary, calling it PicasaImageGallery or whatever.

    Good luck with it. If you’d like to contribute it back, I’d be happy to add it to the code base and offer it on my site.

    Thanks

    Shane

  4. Hi Shane,

    First of all amazing work here! It really helped me in understanding DOJO concepts as well as REST architecture.

    Now i was trying to build a similar client with which you can upload photographs to flickr, but was confused how to pass data to it.
    Also how do I to implement my own REST service something like flickr which consumes messages with data in them ?

    Any leads would be appreciated.

    Thanks,

    Sam

  5. Hi Shane, I’m testing out the gallery you wrote, using the new dojo 1.1 release. I like it a lot. I’d really like to be able to choose a set to display, though, and am wondering if you had implemented that part of it. (just referring back to your comment about eventually adding support for that).

    Thanks,
    Christine

  6. hi Shane, great work you have done..

    I have one thing to ask though…
    can you modify it? Instead of getting images from flicker can you get the images from a local directory?

    I hope you can help me…
    I really appreciate your work..

    thanks Shane…

  7. Hello. I wanted to know if you are still working on this application. I am trying to implement something like this into one of our websites, and cannot seem to find anything else like this.

  8. Hello,

    I try to use dojox.gallery (1.3b3) in a div with dojotype contentPane loading with setHRef function. The problem is that no thumbnails are generated, all images are large.
    Do you have an idea ?

    Thanks

  9. Hi Jean-Pascal,

    Are you including the correct CSS on the page? You need to make sure that dojox/image/resources/image.css is included on the page.

    If you are doing that correctly, and it’s still not working, can you please put a full sample HTML page on the web for me to look at?

    thanks

    Shane

  10. Hi,

    Love the program, want to use it for a client’s site (he’s a auto customizing shop) but I need to put each job separate (i.e. Harley, Limo, Ricer, 57 Chevy). If that’s possible it would be perfect for what I’m doing. Can’t think of any other features I would need.

  11. Hello Shane.

    As all have mentioned, GREAT Work!!! šŸ™‚

    I, like many before, would love to select our images from Flickr by Set, any news on that?

    Many thanks

  12. What I meant was have each car on it’s own page, so the client can upload his pictures to Flickr,and then the web site can grab them.

  13. @Andrew, thanks a lot. It is possible to select photos from a single users stream based on the set id. In your request to the FlickrRestStore, specify the the “setid” parameter, which you can get from the URL of the set.

    For example, in the following url:

    Fran And  Me on the Cliff

    the “setid” is the last number.

    Shane

  14. PERFECT!!!!!

    That’s great Shane that’s for that šŸ™‚
    This works realy well now.

    Do you have any idea why IE6 chops the Lightbox image in half?
    Or why the control button in IE8 are only clickable on 1px?

    The really wierd thing is that I had Lightbox working in IE6 on this site: http://pandpwindows.com/picturegallery.html click on the thumbnails(really bad design, pls don’t laugh).
    Although wen I tried the same code on this site: http://www.karateeastkent.co.uk/html/lbtestflkek.html (please find he Show flickr lightbox button (bad box model)) this loses half the image?

    I’m really greatful for any help you can give me šŸ™‚

    Thanks again

    Andrew

  15. The people behind Flickr are crazy about creating new ways of organizing photos and video and making it easy for users to organize and store their precious digital memories. As a user, you can allow all your contacts and friends to comment on your photos and even reorganize them.

Leave a comment