1
0
mirror of https://github.com/jbranchaud/til synced 2026-03-04 06:58:45 +00:00

Add Inspect EXIF Data For An Image File as a Unix TIL

This commit is contained in:
jbranchaud
2026-02-22 11:52:47 -06:00
parent 2cc52bf8bc
commit e41802653d
2 changed files with 49 additions and 1 deletions

View File

@@ -10,7 +10,7 @@ working across different projects via [VisualMode](https://www.visualmode.dev/).
For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter). For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter).
_1743 TILs and counting..._ _1744 TILs and counting..._
See some of the other learning resources I work on: See some of the other learning resources I work on:
@@ -1710,6 +1710,7 @@ If you've learned something here, support my efforts writing daily TILs by
- [Ignore A Directory During ripgrep Search](unix/ignore-a-directory-during-ripgrep-search.md) - [Ignore A Directory During ripgrep Search](unix/ignore-a-directory-during-ripgrep-search.md)
- [Ignore The Alias When Running A Command](unix/ignore-the-alias-when-running-a-command.md) - [Ignore The Alias When Running A Command](unix/ignore-the-alias-when-running-a-command.md)
- [Include Ignore Files In Ripgrep Search](unix/include-ignore-files-in-ripgrep-search.md) - [Include Ignore Files In Ripgrep Search](unix/include-ignore-files-in-ripgrep-search.md)
- [Inspect EXIF Data For An Image File](unix/inspect-exif-data-for-an-image-file.md)
- [Interactively Browse Available Node Versions](unix/interactively-browse-availabile-node-versions.md) - [Interactively Browse Available Node Versions](unix/interactively-browse-availabile-node-versions.md)
- [Interactively Switch asdf Package Versions](unix/interactively-switch-asdf-package-versions.md) - [Interactively Switch asdf Package Versions](unix/interactively-switch-asdf-package-versions.md)
- [Interpret Cron Schedule From The CLI](unix/interpret-cron-schedule-from-the-cli.md) - [Interpret Cron Schedule From The CLI](unix/interpret-cron-schedule-from-the-cli.md)

View File

@@ -0,0 +1,47 @@
# Inspect EXIF Data For An Image File
The `exiftool` CLI (which can be downloaded via `brew`) is a useful tool for
inspecting all the EXIF data attached to a media file. A media file like an
image has a bunch of additional details embedded in it like timestamps, image
metadata, and sometimes location information.
Here is all the data attached to a screenshot I found on my desktop:
```bash
exiftool ~/Desktop/CleanShot\ 2025-11-17\ at\ 11.22.18@2x.png
ExifTool Version Number : 13.50
File Name : CleanShot 2025-11-17 at 11.22.18@2x.png
Directory : /Users/lastword/Desktop
File Size : 1194 kB
File Modification Date/Time : 2025:11:17 11:22:21-06:00
File Access Date/Time : 2025:12:15 10:43:55-06:00
File Inode Change Date/Time : 2025:12:05 15:37:48-06:00
File Permissions : -rw-r--r--
File Type : PNG
File Type Extension : png
MIME Type : image/png
Image Width : 2502
Image Height : 1232
Bit Depth : 8
Color Type : RGB with Alpha
Compression : Deflate/Inflate
Filter : Adaptive
Interlace : Noninterlaced
XMP Toolkit : XMP Core 6.0.0
Y Resolution : 144
Resolution Unit : inches
X Resolution : 144
Exif Image Width : 2502
Color Space : sRGB
User Comment : Screenshot
Exif Image Height : 1232
SRGB Rendering : Perceptual
Image Size : 2502x1232
Megapixels : 3.1
```
This works with other kinds of media files. For instance, I ran this against an
MP4 screen recording file which contained even more metadata.
In addition to reading data, `exiftool` can also write it. See `man exiftool`
for more details on what else it can do.