Math Jazz — Mathias Bynens’s shizzle, y’all



Note: This site might seem inactive… That’s because it is. Don’t worry though, I’m still coding webpages and stuff! If you’re interested, I suggest you get a translator and head over to Qiwi; or you could just check the latest site we’ve been working on: Apotheek Goethals – Debrabandere. Enjoy!

Photo Gallery URIs

It is a problem. Ever since Markku announced that iPAP shall soon (?) have a MySQL backend, I’ve been wondering about my photo gallery. Not the one on Flickr, but the one on this very site. I’m assuming there won’t be an upgrade script included in iPAP 1.0 — which is fine, I’m sure Markku is a busy man —, so I’ll start a new gallery from scratch then. (Even if there will be such a script, a fresh install won’t hurt.)

So, I’m secretly running an iPAP install somewhere on this site, which I’m hacking to suit to my needs as much as possible.

The reason I’m telling you all this is because I was wondering about perfect photo gallery URIs the other day. I think we can all agree that, in this case, the base photo gallery folder should be /photos/. Photo albums then have permalinks among the lines of /photos/sanitized-album-name/. So far, so good. But what about single photo pages? Personally, I think the best solution is to make the first photo in Album One have a link like /photos/album-one/1/. The second photo in that album can then be seen on /photos/album-one/2/, and so on. Album Two has a similar URI structure: /photos/album-two/1/, /photos/album-two/2/, and so on. Get it?

The problem then is that there are is no photo gallery software/service using this kind of URIs… iPAP, for example, uses ID-based permalinks, e.g. /photos/sanitized-album-name/233/, even if that’s the first photo of the album. And on Flickr, it’s even worse.

So maybe, I was wrong… Or wasn’t I? Let’s have a little poll, shall we? Please vote for your favourite URI structure in the comments.

First photo in an album:

Twentieth photo in an album:

Filed under HTTP · February 4th, 2005

Comments (11)

Listed below are the responses for this entry.

  1. Hayo Bethlehem:
    This commenter’s Gravatar

    I use C. The number-in-album tends to shift in my app. So I went for the really unique URI. I don’t really like filling with zeroes, seems a bit like useless bytes to me :)

    Comment posted on February 4th, 2005 @ 9:39 pm
  2. Mathias:
    This commenter’s Gravatar

    I use C. The number-in-album tends to shift in my app.

    Yeah, but imagine the perfect photo gallery system — what kind of URIs would that produce? Is it truly any better to use really unique URIs?

    Comment posted on February 5th, 2005 @ 12:39 pm
  3. Hayo Bethlehem:
    This commenter’s Gravatar

    It depends. I don’t think there’s a lot of difference, it more depends on what you like to emphasize on. My emphasize is on the images. The URIs are meant for the permanent location of a single image. So, while its place in the album may vary, the URI will never die, and the visitor will never be confronted with a different image (different from the image he viewed on that link two months ago, before you decided to replace image #8).

    But it could be that the album in itself is more important then the images, in that case, I wouldn’t choose option C. Will the app be photospecific or album specific?

    Comment posted on February 5th, 2005 @ 4:37 pm
  4. Rob Mientjes:
    This commenter’s Gravatar

    Photospecific sounds best. It will make categorisation easier, like with tags instead of albums or something like that.

    Comment posted on February 5th, 2005 @ 4:40 pm
  5. Mathias:
    This commenter’s Gravatar

    The photos are of course the most important thing, but personally I have a tendency to organize all pictures in sets/albums. And if there’s no album they fit in, I simply create a new one.

    The question is: how photospecific can it get when you’re using an app which requires a photo to be in an album?

    iPAP will include a labeling thing, a simple way of categorizing your photo albums. It’s like Flickr photo tags for iPAP albums. (It can be seen in action on Markku’s photo gallery.)

    Comment posted on February 5th, 2005 @ 4:54 pm
  6. Hayo Bethlehem:
    This commenter’s Gravatar

    The ultimate way to do it would be to name each image. You would get /photos/holiday-to-slovenia/at-the-airport/ … That might be a lot of work though :)

    Comment posted on February 6th, 2005 @ 12:55 am
  7. Indranil:
    This commenter’s Gravatar

    Naming upto the album level will be fine. Otherwise, each photo has to be descriptively named or titled. You can use the WordPress title style with the nice URIs.

    Comment posted on February 6th, 2005 @ 3:04 am
  8. markku:
    This commenter’s Gravatar

    Naming every single photo is a lot of work indeed. Right now, I like the way I do it with iPAP, that’s choice D. Using choice A or B is quite cumbersome if you decide to change the order of the photos in an album. By the way, I like to pad the ID just to make the URLs appear to have consistent length. :)

    Comment posted on February 6th, 2005 @ 2:43 pm
  9. MrSomeone:
    This commenter’s Gravatar

    I would think using the photo’s name instead of a unique ID would make the URIs more understandable. (Something like /photos/album-name/photo-title/.) But that could also lead to problems if you give more than one photo in the same album the same title, so I would say choice A.

    Comment posted on February 13th, 2005 @ 5:50 pm
  10. Joachim:
    This commenter’s Gravatar

    Markku, what’s choice C? And best wishes “pare” on your iPAP 1.0 release, mabuhay ang pinoy!

    Comment posted on February 15th, 2005 @ 8:16 am
  11. Mathias:
    This commenter’s Gravatar

    What’s choice C?

    Try reading the post. :P Choice C means URIs with totally unique IDs as permalinks.

    Comment posted on February 15th, 2005 @ 8:08 pm