More options with exiftool: grab only selected tags.

exif exiftool images

Exiftool is this neat command line utility written in perl that can pull out a bunch of the metadata associated with images acquired by consumer-type devices. (Read more about Exif if you want). I use it a lot for work and personally.

To install on Ubuntu:

sudo apt install libimage-exiftool-perl

Read more here, exiftool.org/, and keep scrolling down to get to the good stuff.

Previously I had only used it the most typical way, which returns all of the avaliable tags (for example, at the end of this post]). Here, I direct to a file because this can be long.

exiftool Amy-cameraTrap.JPG  > out.txt

but I wondered if there was a way to only get the output of particular tags, and it turns out there is. First, you need to know how to format the tag.

exiftool -s Amy-cameraTrap.JPG > labels.txt

to get a listing of the labels. Say I want the height:

$ exiftool -imageheight DSC_0232.jpg 
Image Height                    : 2048

Example Full Output

ExifTool Version Number         : 10.80
File Name                       : Amy-cameraTrap.JPG
Directory                       : .
File Size                       : 3.1 MB
File Modification Date/Time     : 2021:05:12 11:35:36-04:00
File Access Date/Time           : 2021:05:11 20:00:00-04:00
File Inode Change Date/Time     : 2021:05:12 11:40:59-04:00
File Permissions                : rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Little-endian (Intel, II)
Make                            : apeman
Camera Model Name               : H45
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : 00.01.38
Modify Date                     : 2021:04:07 07:33:41
Y Cb Cr Positioning             : Co-sited
Exposure Time                   : 1/30
F Number                        : 3.2
Exposure Program                : Program AE
ISO                             : 100
Exif Version                    : 0220
Date/Time Original              : 2021:04:07 07:33:41
Create Date                     : 2021:04:07 07:33:41
Components Configuration        : Y, Cb, Cr, -
Compressed Bits Per Pixel       : 2
Brightness Value                : -5
Exposure Compensation           : 0
Max Aperture Value              : 1.7
Metering Mode                   : Multi-spot
Light Source                    : Unknown
Flash                           : No Flash
Focal Length                    : 7.5 mm
Subject Area                    : 1824 1024 3648 2048
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 3648
Exif Image Height               : 2048
Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100
File Source                     : Digital Camera
Scene Type                      : Directly photographed
Custom Rendered                 : Normal
Exposure Mode                   : Auto
White Balance                   : Auto
Digital Zoom Ratio              : 0
Focal Length In 35mm Format     : 0 mm
Scene Capture Type              : Standard
Gain Control                    : None
Contrast                        : Normal
Saturation                      : Normal
Sharpness                       : Normal
Subject Distance Range          : Unknown
Compression                     : JPEG (old-style)
Thumbnail Offset                : 902
Thumbnail Length                : 7007
Comment                         : SMF0..06350658
Image Width                     : 3648
Image Height                    : 2048
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:2 (2 1)
Aperture                        : 3.2
Image Size                      : 3648x2048
Megapixels                      : 7.5
Shutter Speed                   : 1/30
Thumbnail Image                 : (Binary data 7007 bytes, use -b option to extract)
Focal Length                    : 7.5 mm
Light Value                     : 8.3

© Amy Tabb 2018 - 2023. All rights reserved. The contents of this site reflect my personal perspectives and not those of any other entity.