Sunday, July 22, 2007

Rotating and tagging en-masse in Flickr

I recently decided to use Flickr seriously, and upload all my pictures, which so far have languished unreviewed on my PC somewhere. So after a few days of uploading I had about 4,500 images on my Flickr account, and a need to start the herculean task of indexing them. The Organisr is great, but only for really big batch jobs, and the photo page can do anything to one photo, but I needed to do the same few things to lots of photos - title, description, deleting crud, rotating portrait shots, tagging.

Three of those five you can already do on the Stream view page (the 12/18-to-a-page view), but rotating and tagging still seem to require visiting the photo page. Very slow.

So I wrote a greasemonkey script (GM script: Flickr Streamview tools) that adds rotate left, rotate right, and add tags buttons to each photo on the streamview page. It's my first greasemonkey script and there are a few things I dislike about it:

  • For some reason Flickr doesn't always serve the rotated image, but serves a 'this image is unavailable' image instead. It's not actually a problem - refresh and all's well, the image is rotated as ordered. This seems to happen if you have several images in the process of being rotated at the same time.
  • I had to embed an entire MD5 algorithm that is used to compute the signature for authenticated API calls. Anyone know of a better way of doing this?
  • The XML returned from the API calls is parsed using regex rather than navigated as a node tree. For some reason it just didn't work otherwise.

Anyway, subject to the above, it's extremely useful and speeds up my experience of Flickr enormously. Let me know if you have any suggestions.

0 comments: