emirp.net

Scripts for photography

Nautilus script submenu

The photo scripts here are written in a way, so that they can be integrated into the context menu of the Nautilus file manager. That makes them very comfortable to use: just select one, two or as many of your photos as you like in Nautilus, right-click, find the submenu "Scripts" and run them on the selected files.

You need to install the ImageMagick and exiftool package. Then copy the scripts to ~/.local/share/nautilus/scripts/ (on Ubuntu 14.04, other distributions or Ubuntu versions might use different paths) and make sure they are executable. I only use and tested them with JPG-files.

Thumbnail generation (thumbnailgen_mp.sh)

After starting the script a terminal window will open and the size (in megapixels) and the quality of the resulting JPG-files can be typed in. (To use the default 6 megapixels and 92% just press ENTER twice.) Then the script will run through all the selected files and create a scaled-down copy of every file under the name "FILENAME_Xmp.JPG".

If you do not use Nautilus, the following command line is a very handy alternative. It scales down all the JPG-files in the current directory from the terminal:

find . -name "*.JPG" | xargs -l -i basename "{}" ".JPG" | xargs -l -i convert -resize 6000000@\> -quality 92 "{}.JPG" "{}_6mp.JPG"

Strip all EXIF data (exif_stripall.sh)

The script strips all EXIF information from the selected files. The original files are kept and renamed to "FILENAME.JPG.original", which is the standard behavior of exiftool.

Strip embedded EXIF thumbnail (exif_stripthumbnail.sh)

This does the same as the script above, except it only strips embedded thumbnails from the JPGs. It is useful if your photo editor does not update the thumbnail after changes. (I had that issue with a lossless crop tool for JPGs, which was otherwise very nice.)

Web-publishing (photowebpub.sh)

emirp.net watermark

The script positions a prepared PNG-watermark in the bottom right hand corner of the photo, sets the copyright and artist fields of the EXIF data and strips the embedded thumbnail, as well. You will have to adjust your parameters (name, copyright information and the path to your watermark) directly in the script code. And you will certainly have to play around a bit with your watermark-PNG before it looks good and works for you.