67.9 Photo Remove Metadata

20220116

When sharing photos publicly it could be useful to ensure there is no personal information included in the metadata. Such metadata can be removed before sharing the photo.

First check the meta data of a photo using exiftool:

$ exiftool photo.jpg
ExifTool Version Number         : 10.80
File Name                       : photo.jpg
Directory                       : .
File Size                       : 47 kB
...
File Permissions                : rw-r-----
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Exif Byte Order                 : Little-endian (Intel, II)
Make                            : samsung
Camera Model Name               : SM-G930F
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : GIMP 2.8.22
...
Y Cb Cr Positioning             : Centered
Exposure Time                   : 1/50
F Number                        : 1.7
Exposure Program                : Program AE
ISO                             : 100
Exif Version                    : 0220
...
Image Width                     : 153
Image Height                    : 600
Encoding Process                : Baseline DCT, Huffman coding
Image Size                      : 153x600
Megapixels                      : 0.092
Scale Factor To 35 mm Equivalent: 6.2
Shutter Speed                   : 1/50
...
Hyperfocal Distance             : 2.14 m
Light Value                     : 7.2

Before sharing a photo, and particularly if you want to remove any potentially private information, use the -all= option of exiftool. This will set many meta tags to the empty string.

exiftool -all= photo.jpg

Now check the photo again to see much less metadata:

$ exiftool photo.jpg
ExifTool Version Number         : 10.80
File Name                       : photo.jpg
Directory                       : .
File Size                       : 40 kB
...
File Permissions                : rw-r-----
File Type                       : JPEG
File Type Extension             : jpg
Image Width                     : 153
Image Height                    : 600
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Megapixels                      : 0.092


Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0