• Please use real names.

    Greetings to all who have registered to OPF and those guests taking a look around. Please use real names. Registrations with fictitious names will not be processed. REAL NAMES ONLY will be processed

    Firstname Lastname

    Register

    We are a courteous and supportive community. No need to hide behind an alia. If you have a genuine need for privacy/secrecy then let me know!
  • Welcome to the new site. Here's a thread about the update where you can post your feedback, ask questions or spot those nasty bugs!

Exif metadata - image dimensions

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.
 

Doug Kerr

Well-known member
This is to update my earlier report on image pixel dimensions, as it pertains to image files written by Photoshop (the testing was done with PS CS5).

***************

Photoshop practice

Imagine a camera file that, in Photoshop, has had its pixel dimensions changed (by cropping, resampling, or both), and the image saved normally as a JPG file. Then:

• The current dimensions of the image are reflected in the "header" information for the JPEG image itself [in particular, in what is called SOF(0), the basic Start of Frame marker, or Frame Header]. This is information needed for the reconstruction of the image.

• The current dimensions of the image are stored in ExifIFD.
We can think of this as being the part of the Exif metadata that is actually new with the Exif file format.​

The formal designations of the fields are:

PixelXDimension (often reported as Exif Image Width)
PixelYDimension (often reported as Exif Image Height)​

• The original (camera) dimensions of the image are stored in IFD0.
We can think of this as the "TIFF legacy " portion of the Exif metadata.​

The formal designations of the fields are:

ImageWidth
ImageLength (often reported as Image Height)​

Reported dimensions

When Windows Explorer reports the pixel dimensions of a JPEG file, the report is based on the information in the "JPEG header" [in SOF(0)]. It would be reported even if there was no metadata in the image file.

The image pixel dimensions reported by Photoshop in its File Info panel are those in ExifIFD (fields PixelXDimension and PixelYDimension), if they exist. Otherwise, the dimensions are reported from the "JPEG header" (the actual image dimensions).

Best regards,

Doug
 
Top