Mika Huurre

You are here:   Home > This'n'that > Gadgets > exinfo-write
fi

exinfo-write

(Aug 28, 2014, keywords: exif, writing, script)

This Perl script writes EXIF data to image files:

  • creator (Iptc.Application2.Byline, Xmp.dc.creator)
  • copyright (Iptc.Application2.Copyright, Xmp.dc.rights)
  • location (Iptc.Application2.SubLocation, Xmp.iptc.Location)
  • title (Iptc.Application2.ObjectName, Xmp.dc.title)
  • description (Iptc.Application2.Caption, Xmp.dc.description, Exif.Image.ImageDescription)
  • keywords (Iptc.Application2.Keywords)

EXIF-keys are defined in script but they are easy to replace if needed.

Disclaimer: This script is a part of my photo workflow. It might fit (modified) for you or it may be not. If this script breaks something, you can keep all the pieces. You can do unfunny things (without meaning it) with this script to your images, so backup originals before. I might add that my cameras are made by Olympus, so script functioning is leaning a bit towards this brand.

requirements

  1. linux (ubuntu, debian, debian-derivates, centos, redhat etc.)
  2. perl 5
  3. GNU coreutils 7.4
  4. exiftool

setup

  1. Ensure that exiftool is installed in your machine (yum, aptitude, synaptic et al.)
  2. Load script (and check contents that you know what you're getting).
  3. In terminal copy script to directory /usr/local/bin (input bold, backslash means that next line is part of the current one):



    user@teac:~/Downloads$ sudo cp exinfo-write.pl \
    /usr/local/bin/exinfo-write

    [sudo] password for user: [your-passwd-here]




  4. Set script rights for execution:



    user@teac:~/Downloads$ sudo chmod ugo+x /usr/local/bin/exinfo-write
    user@teac:~/Downloads$ ls -l /usr/local/bin
    total 28
    :
    -rwxr-xr-x. 1 root root 17711 Aug 24  2014 exinfo-write
    :




  5. Make a test run:



    user@teac:~/Downloads$ exinfo-write -v -c

    doing dependency check:  passed

    user@teac:~/Downloads$



    If something else pops up (usually an error message), you have to fix enviroment accordingly. Script checks that exiftool program is found and complains if it's not. Google/Bing/etc. are probably your best friend here.

    You can get help by providing option -h:



    user@teac:~/Downloads$ exinfo-write -h


usage

With this script you can write image(s) author, copyright, title, description, location, date and keywords from command line.

For example:


user@teac:~/Pictures/DCIM-temp$ exinfo-write -i -a "Mika Huurre" \
-r "Copyright (C) 2014 by Mika Huurre" -l "Helsinki" \
-d "Summer pictures" hki-pics
/


You can get best view of command line options by reading the help and trying the script out. You can write data either to one image file or to all image files in directory.

This script was made mainly to compliment my photo editing workflow, so it must be tested and modified if necessary.

script

Version 20140702-1

As file: exinfo-write.pl

comments

  • Note that exinfo-write can write only those image files that exiftool can write; it is possible that exiftool that comes with your distribution is not necessarely the latest version, so you might have to download latest exiftool source code and compile it.

 

Powered by CMSimple_XH | RO