
IPTC (from the International Press Telecommunications Council) is the direct digital descendant of the standardized notes that wire services used to fax to accompany pictures back in the 1970s. There are three common standard formats for picture metadata.
EXIFTOOL CLI FULL
A thread at Perl Monks contains a full example of importing tab-delimited data into MySQL in this way.

Such a format can be immediately loaded in a MySQL database with the LOAD DATA INFILE, FIELDS TERMINATED BY, and LINES TERMINATED BY options. If you want to export all the metadata to a relational database, a better way is to use a command like exiftool -t -S PICTURE_DIR | grep -v ^= > picture_tags_values.txt, which writes to picture_tags_values.txt all the EXIF tags of all the pictures inside PICTURES_DIR, separated by tabs, one picture per line. The -w option instead writes all the EXIF tags found inside a picture into a text file, or, if you add -htmlDump, an HTML file. The -TagsFromFile option copies all tags from the file specified right after it to the one given as final argument: exiftool -TagsFromFile tagged_picture.jpg untagged_picture.jpg. If you have one JPEG file that already contains all the EXIF metadata you need, you don’t have to type it again to add it to other pictures. With the right software, shifting the timestamp or modifying the comments of all your pictures takes only one command. It’s not uncommon to realize only after you’re back from a trip abroad that you didn’t set the local time correctly in your digital camera, or that you mistyped the hotel name using that darn little on-screen keyboard. Also, it makes easier to correct wrong metadata quickly.

Luckily, one strategy doesn’t preclude the other.Įmbedding metadata inside pictures with command-line tools has two great advantages: it may be much faster than working with GUI-based tools, especially when working with many files that never had metadata associated with them, such as scanned photos of your grandfather’s graduation.
EXIFTOOL CLI ARCHIVE
You can be sure the metadata will always remain associated with the image and that nobody will have to manually enter it again, even if you change your picture management software, archive your pictures on DVDs, or give away copies to friends.
EXIFTOOL CLI PORTABLE
On the other hand, storing as many metadata tags as possible inside the picture file they refer to is a much more portable solution. Where should metadata be stored, in some centralized database or inside each file? The first is more efficient if you have large numbers of digital pictures you want to search in many different ways. Several options allow recursive operations inside directory trees. By default a separate copy of the original file is saved with the “_original” suffix. You just need to type exiftool and then the name (prepended by a dash) and value of each EXIF tag to write. The basic syntax to add or modify EXIF tags is simple. So, for instance, to save a local, commented copy of a JPEG picture you found online, you can use a command like wget -qO - | exiftool -Comment="African Sunset" > localcopy.jpg. The utility can read and write data and pictures from pipes or (remote) files without any problem.


It comprises a multiplatform bundle of some Perl modules for EXIF processing plus a small program called exiftool to use them from the command line.
EXIFTOOL CLI HOW TO
In this article we’ll see how to use ExifTool to manage EXIF data inside JPEG files.ĭue to its architecture, ExifTool is very flexible. ExifTool is an efficient, flexible, and portable way to manage image, audio, and video metadata under Linux. Digital media files are more useful and accessible when tagged with metadata - that is, descriptive information about each photo that either can be embedded inside images themselves or stored in external databases.
