No description
Find a file
2025-12-21 11:49:02 -08:00
bin/linux Use stfrunner to test metar. 2025-12-21 11:41:17 -08:00
docs Simplify the build process. 2025-12-21 11:49:02 -08:00
env Use stfrunner to test metar. 2025-12-21 11:41:17 -08:00
metar Fix index error. 2025-10-19 11:55:22 -07:00
python Remove unused files. 2025-10-19 13:29:23 -07:00
stf-files Use stfrunner to test metar. 2025-12-21 11:41:17 -08:00
testfiles Add tests that run the test images through metar. 2025-10-19 14:02:03 -07:00
tests Remove perl dependency. 2025-12-19 15:16:32 -08:00
.gitignore Update code to build the dependency graph. 2025-10-19 11:29:13 -07:00
build Simplify the build process. 2025-12-21 11:49:02 -08:00
LICENSE Create LICENSE 2020-01-04 15:32:35 -08:00
metar.nimble Remove unused files. 2025-10-19 13:29:23 -07:00
readme.md Replace the re module with nre. 2025-12-19 13:31:07 -08:00
runenv Use bash scripts to run the docker build env and to build the code. 2025-10-19 09:04:51 -07:00

Metar is a command line program for reading image metadata.

You can read metadata from JPEG, DNG and TIFF images. Metar understands the standard image metadata formats: XMP, IPTC, Exif, and Tiff tags.

You can use metars range feature to reverse engineer file formats. It tells all known and unknown bytes in the file. You write code to handle the unknown byte ranges until all are known. This allows you quickly get the basics working and gradually fill in the edge cases over time.

How to Run Metar

You can run metar from the command line to display image metadata. Running metar without any parameters shows how to use it. For example::

metar

Show metadata information for the given image(s).
Usage: metar [-j] [-v] file [file...]
-j --json     Output JSON data.
-v --version  Show the version number.
-h --help     Show this help.
file          Image filename to analyze.

You pass an image filename and metar outputs metadata to the screen, for example::

metar testfiles/image.dng

========== ifd1 ==========
offset = 8
next = 0
NewSubfileType(254) = [1]
ImageWidth(256) = [256]
ImageHeight(257) = [171]
BitsPerSample(258) = [8, 8, 8]
Compression(259) = [1]
PhotometricInterpretation(262) = [2]
Make(271) = ["Canon"]
Model(272) = ["Canon EOS 20D"]
...

Only the first few lines are shown in the example above to save space. For this image there are 291 lines::

metar testfiles/image.dng | wc -l
291

More Pages

You can learn how to build, test and install on the development page.

You can learn how metar deals with special images with unknown sections or corrupt files and other details on the details page.

  • details -- metadata processing details

Here is the metar module dependencies graph:

  • dependencies