Posts Tagged ‘exiftool’
Need to quickly off-load photos from your camera and neatly organize them into folders by date? The Fotobasher shell script cobbled together by yours truly can help you with that.
The script copies photos from a mounted storage device like an SD card to the TMP directory, organizes the photos into folders by date, and then renames each photo using the data pulled from the photo’s metadata. Photos are renamed using the YYYYMMDD-HHMMSS-ShutterCount.EXT format, so the resulting file name looks something like this: 19730115-135547-3375.NEF. Fotobasher is configured to work with Nikon D90, but adapting the script to other camera models requires only a few simple tweaks.
If you have Git installed on your machine, you can clone the Fotobasher Git repository using the following command:
git clone git://github.com/dmpop/fotobasher.git
Alternatively, you can download the latest release of Fotobasher from the project’s download page.
To make Fotobasher work on your machine, you need to do some preparatory work. Start with installing the ExifTool utility which the script uses to extract relevant metadata, arrange photos, and rename them. ExifTool is available in the software repositories of many mainstream Linux distributions, so you can install it using your distro’s package manager. On Debian and Ubuntu, you can do this by executing the following command:
sudo apt-get install libimage-exiftool-perl
Next, make the fotobasher.sh script executable using the following command:
chmod +x fotobasher.sh
Rename then the ExifTool_config file to .ExifTool_config and move it to your home directory:
cp fotobasher/ExifTool_config ~/.ExifTool_config
Adding the .ExifTool_config file is required only if you want to include the shutter count value in the file names. In case you use another renaming rule, you can skip this step.
Finally, open the script in a text editor and specify the desired TARGET_DIR value and the correct file format (e.g., RAW, CR2, or JPG).
That’s all there is to it. Insert the card with photos, run the script to download the photos, arrange them into folders, and rename them.
Need to quickly geotag a bunch of photos taken at a specific location? ExifTool is your friend. Using this powerful command-line tool, you can geotag multiple photos with a single command. Before you proceed, make sure that ExifTool is installed on your machine. To install ExifTool on Ubuntu, execute the sudo apt-get install libimage-exiftool-perl command. Next, you have to obtain the longitude and latitude of the desired geographical location, and feed the coordinates to ExifTool as follows:
exiftool -GPSLongitudeRef=E -GPSLongitude=139.7513889 -GPSLatitudeRef=N -GPSLatitude=35.685 *.jpg
This command will geotag all JPEG images in the current directory. If you are running Windows, download the latest version of the ExifTool executable and rename it as in the example below:
exiftool (-GPSLongitudeRef=E -GPSLongitude=139.7513889 -GPSLatitudeRef=N -GPSLatitude=35.685).exe
Drag and drop the photos you want to geotag onto the executable and ExifTools will do the rest. Besides GPSLongitudeRef, GPSLongitude, GPSLatitudeRef, and GPSLatitude, ExifTools supports a number of other tags. Check the GPS Tags page for further info.