43

image Extracting Metadata from Image Files

This tutorial shows how to detect the endianness of a TIFF file. The general principle applies to a variety of other header data that you can extract from any kind of file. The idea is to open a data file, pick out some binary-coded information from the header, and format the result.

In this case, we will use a command in the UNIX system called od. It is named after the Octal Dump facility that it provides, but it extracts and displays file contents in many other formats. This is useful for accessing the contents of binary files.

The shell script dumps the first few bytes of the file and extracts the Byte ...

Get Developing Quality Metadata now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.