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:
http://domain.ext/photos/sanitized-album-name/1/http://domain.ext/photos/sanitized-album-name/00001/(zero padding up to five digits)http://domain.ext/photos/sanitized-album-name/233/http://domain.ext/photos/sanitized-album-name/00233/(zero padding up to five digits)
Twentieth photo in an album:
http://domain.ext/photos/sanitized-album-name/20/http://domain.ext/photos/sanitized-album-name/00020/(zero padding up to five digits)http://domain.ext/photos/sanitized-album-name/471/http://domain.ext/photos/sanitized-album-name/00471/(zero padding up to five digits)
Comments (11)
Listed below are the responses for this entry.
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 :)
Yeah, but imagine the perfect photo gallery system — what kind of URIs would that produce? Is it truly any better to use ?
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?
Photospecific sounds best. It will make categorisation easier, like with tags instead of albums or something like that.
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, . It’s like Flickr photo tags for iPAP albums. (It can be seen in action on Markku’s photo gallery.)
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 :)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.
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. :)
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.Markku, what’s choice C? And best wishes “pare” on your iPAP 1.0 release, !
Try reading the post. :P Choice C means URIs with totally unique IDs as permalinks.