Automated Photo Borders

Posted by matt
on Tuesday, July 15

If you’ve ever wanted to automatically add a coloured border to an image, then this ruby script might come in handy.

add_border.rb does exactly what you expect; it adds a border. You can specify the outer and inner sizes, and the colour of the inner border between. By default, this colour will be the average RBG value, giving you an awesome look by default.

To use it, just run ruby ./add_border.rb, or chmod +x it, and run ./add_border.rb. Available arguments are:

  • --help or -h for help.
  • --color, or -c to specify the border colour
  • --inner, or -i for the inner (coloured) border thickness
  • --outer or -o for the outer (black) border thickness
  • remaining arguments are considered filenames to process.

The script will output files whose names are the same, but with _border added before the filetype suffix, so that my_image.jpg would become my_image_border.jpg.

You can get it from:

  • svn
  • Github (preferred) as I probably won’t update SVN anymore.

add_border.rb requires RMagick.

Note: I lost the original description page when I nuked my site. So this is a new one.

snarfr

Posted by matt
on Tuesday, July 15

snarfr is a ruby script designed for simply backing up your flickr photos.

It requires a few gems, notably:

  • flickraw
  • progressbar (≥ 0.9 see: here)
  • mini_exiftool
  • facets/ostruct

To run it, type ruby snarfr.rb, or chmod +x it, and then do ./snarfr.rb. It should then begin snarfing yours photos into ./output, unless you’ve specified an output directory (as the first argument), in which case things will go there.

snarfr tries to be intelligent by saving it’s progress to the file ~/.snarfr, but it only does this when it exits normally. On the first run, it will ask you to authorise it, to do that, you need to visit the URL it gives.

You can find snarfr in subversion at: snarfr svn, ready for you to snarf. Or you can get it from GitHub at: snarfr.

Note: I lost the original description page when I nuked my site. So this is a new one.