I would like to use Python to extract the dimensions of a TIFF image. That will return the width and height in pixels.
The same question was asked here
How to extract dimensions for Jpegs , Png and Gif files with python with using add in modules
The answer above does not address tiff files.
I cannot add an modules at work I need a solution that will not use any add in modules.
I have found the specifications listed here
it states that Tiff header is 8 bytes long
The first two bytes are either ii or MM depending on the last 4 bytes are the Offset to the IFL(Image file directory). Its inside the IFL that contains the information related to the height and width. But the IFL can be a variable size, dependent on what is inside it. Also if there are several images. The last four bytes of the IFL will be a offset to the next IFL.
The adobe specifications for TIFF are here: tiff 6.0 version adobe - It shows an example of the tiff structure on page 20.
I was wondering if someone might have had some experience with this . I struggle to understand , how to get inside the IFL and extract the information I like