A while back, Luis Villa asked about a script to add creative commons licensing information to an image. My first thought was to just use ImageMagick. That works pretty well, but assumes a command line, image magick, etc. My next thought was a piece of javascript that you could include on a webpage. The javascript would scan all <img> tags and for each that were of the class “cc-license”, it would grab the “license” and “attrib” attributes. The img would be replaced with a canvas that had a transparent license image and the attribution in the corner. That worked pretty well, but again, didn’t really change the image, so if you were loading it into a presentation, etc., you were out of luck.
Okay, thought the third. Why don’t we take the canvas idea (idea #2 for those keeping score at home) and wrap it in a GreaseMonkey script. The script would run on Flickr pages and, when triggered, would grab CC license information, along with the picture name and creator from the Flickr API and shove it into a canvas. That canvas could be downloaded as a png (don’t blame me, using png as opposed to something else is an HTML5 issue). Okay, this might work.
Basic use:
- install and enable GreaseMonkey in firefox
- download the script – GreaseMonkey should pick up the fact that’s it’s a script
- go to Flickr
- follow the instructions for getting a Flickr API key
- install the key through the GreaseMonkey -> User Script Commands menu
- find an image you like – either the main page image or on the “All Sizes” screen
- click the “Click to Annotate with License Link”
- you should see the image with the embedded license info
- right click to save
I wrapped up the first version tonight (October 4, 2008). New features should eventually include the ability to change colors, degree of transparency, location, etc., but for now it’ll work.
Version 1.0 – annotateflickr.user.js