Doug Kerr
Well-known member
I thought I would talk a little about the representation of image dimensions (in pixels) in Exif metadata.
Background
The Exif metadata scheme is an outgrowth of the metadata scheme originally devised for use in TIFF files.
The Exif metadata items are held in data structures called IFD's. That stands for Image File Directory, a name probably unwisely hijacked from some other area. It of course makes no sense for these things. In fact, in the Exif specification, which talks at great lengths about IFDs, that underlying name is never mentioned. Perhaps this was just an editorial oversight, but more likely the authors thought that the name was so detached from its significance here that mentioning it at all might really confuse the readers.
Two IFD's are involved in our basic Exif metadata work, usually called IFD0 and ExifIFD. Rather simplistically, IFD0 carries Exif metadata items that were inherited from the TIFF metadata scheme, and ExifIFD carries the ones that were added when the Exif scheme was devised.
By way of illustration, here are some data items held in IFD0 (not the formal item names, just my descriptions):
• Make of the image-generating device (camera)
• Model of the image-generating device (camera)
• X and Y resolution (you know, the meaningless parameters)
• Y Cb Cr positioning
Here are some items held in ExifIFD:
• Date/time taken
• Date/time digitized
• ISO speed
• Exposure program
• Aperture (two ways)
• Maximum aperture
• Shutter speed (two ways)
• Focal length
• FF35 equivalent focal length (!)
• Flash mode
• MakerNote (an area with maybe a lot of proprietary metadata)
There is also another are where metadata is held, often spoken of as the "File" metadata area. Typical data items held there include:
• Byte order for the Exif metadata (big- or little-endian)
• Chrominance subsampling ratios
• Encoding process in compression
Now, it turns out that the image dimensions (in pixels) can be held in any or all of these three places. The data items have the same formal name in any place:
• ImageWidth
• ImageLength
Most Exif reporting programs use Image Height for ImageLength.
Some technical Exif reporting programs refer to ImageWidth and ImageLength as found in ExifIFD as ExifImageWidth and ExifImageHeight, respectively.
Canon camera practice
JPG files emitted by a Canon EOS 40D have the image dimensions in three places:
• In the File metadata area
• In ExifIFD
• In the Maker Note (which is in turn in ExifIFD)
Photoshop practice
To move us fastest through the story, let's imagine a Canon camera file that, in Photoshop, has had its pixel dimensions changed (by cropping, resampling, or both), and the image saved as a JPG file. Then:
• The current dimensions of the image are stored in the File metadata area.
• The current dimensions of the image are stored in ExifIFD.
• The original (camera) dimensions of the image are stored in IFD0.
Most programs that report image file metadata evidently report it as held in ExifIFD.
But it is interesting to note that if we are dealing with a file processed in Photoshop, with the proper "technical" Exif reading tool we can find out the pixel dimensions of the original (camera) file.
Background
The Exif metadata scheme is an outgrowth of the metadata scheme originally devised for use in TIFF files.
The Exif metadata items are held in data structures called IFD's. That stands for Image File Directory, a name probably unwisely hijacked from some other area. It of course makes no sense for these things. In fact, in the Exif specification, which talks at great lengths about IFDs, that underlying name is never mentioned. Perhaps this was just an editorial oversight, but more likely the authors thought that the name was so detached from its significance here that mentioning it at all might really confuse the readers.
Two IFD's are involved in our basic Exif metadata work, usually called IFD0 and ExifIFD. Rather simplistically, IFD0 carries Exif metadata items that were inherited from the TIFF metadata scheme, and ExifIFD carries the ones that were added when the Exif scheme was devised.
By way of illustration, here are some data items held in IFD0 (not the formal item names, just my descriptions):
• Make of the image-generating device (camera)
• Model of the image-generating device (camera)
• X and Y resolution (you know, the meaningless parameters)
• Y Cb Cr positioning
Here are some items held in ExifIFD:
• Date/time taken
• Date/time digitized
• ISO speed
• Exposure program
• Aperture (two ways)
• Maximum aperture
• Shutter speed (two ways)
• Focal length
• FF35 equivalent focal length (!)
• Flash mode
• MakerNote (an area with maybe a lot of proprietary metadata)
There is also another are where metadata is held, often spoken of as the "File" metadata area. Typical data items held there include:
• Byte order for the Exif metadata (big- or little-endian)
• Chrominance subsampling ratios
• Encoding process in compression
Now, it turns out that the image dimensions (in pixels) can be held in any or all of these three places. The data items have the same formal name in any place:
• ImageWidth
• ImageLength
Most Exif reporting programs use Image Height for ImageLength.
Some technical Exif reporting programs refer to ImageWidth and ImageLength as found in ExifIFD as ExifImageWidth and ExifImageHeight, respectively.
Canon camera practice
JPG files emitted by a Canon EOS 40D have the image dimensions in three places:
• In the File metadata area
• In ExifIFD
• In the Maker Note (which is in turn in ExifIFD)
Photoshop practice
To move us fastest through the story, let's imagine a Canon camera file that, in Photoshop, has had its pixel dimensions changed (by cropping, resampling, or both), and the image saved as a JPG file. Then:
• The current dimensions of the image are stored in the File metadata area.
• The current dimensions of the image are stored in ExifIFD.
• The original (camera) dimensions of the image are stored in IFD0.
Most programs that report image file metadata evidently report it as held in ExifIFD.
But it is interesting to note that if we are dealing with a file processed in Photoshop, with the proper "technical" Exif reading tool we can find out the pixel dimensions of the original (camera) file.