content/blog/2022-02-17-exiftool.org

e8577d98faff1bed72ba6f2d204b8b44c6827c23
cleberg.net/content/blog/2022-02-17-exiftool.org rendered · source · history · blame · raw

60 lines · 2071 bytes

 1#+date:        <2022-02-17 Thu 00:00:00>
 2#+title:       Procedure for Removing Image Metadata Using Exiftool Utility
 3#+description: Technical instructions for utilizing Exiftool to systematically strip metadata from image files to ensure privacy and reduce file size.
 4#+slug:        exiftool
 5#+filetags:    :exiftool:metadata:image-processing:
 6
 7** Why Strip Metadata?
 8
 9Okay, so you want to strip metadata from your photos. Perhaps you take
10pictures of very rare birds, and the location metadata is a gold mine
11for poachers, or perhaps you're just privacy-oriented like me and prefer
12to strip metadata from publicly-available images.
13
14There are various components of image metadata that you may want to
15delete before releasing a photo to the public. Here's an incomplete list
16of things I could easily see just by inspecting a photo on my laptop:
17
18- Location (Latitude & Longitude)
19- Dimensions
20- Device Make & Model
21- Color Space
22- Color Profile
23- Focal Length
24- Alpha Channel
25- Red Eye
26- Metering Mode
27- F Number
28
29Regardless of your reasoning, I'm going to explain how I used the
30=exiftool= package in Linux to automatically strip metadata from all
31images in a directory (+ subdirectories).
32
33** Installing =exiftool=
34
35First things first: we need to install the tool. I'm running Debian 11
36on my server (Ubuntu will work the same), so the command is as simple
37as:
38
39#+begin_src sh
40sudo apt install exiftool
41#+end_src
42
43There are different tools that can accomplish the same thing across
44distributions, but I really only care to test out this one package.
45
46** Recursively Strip Data
47
48I actually use this tool extensively to strip any photos uploaded to the
49website that serves all the images for my blog (=img.cleberg.net=).
50
51The following command is incredibly useful and can be modified to
52include any image extensions that =exiftool= supports:
53
54#+begin_src sh
55exiftool -r -all= -ext jpg -ext png /path/to/directory/
56#+end_src
57
58The output of the command will let you know how many directories were
59scanned, how many images were updated, and how many images were
60unchanged.