exiftool.exe -canon gives wrong Image Size

Started by Archive, May 12, 2010, 08:54:41 AM

Previous topic - Next topic

Archive

[Originally posted by krkj on 2009-10-30 14:32:00-07]

Great stuff!  However:

C:\fotos> exiftool.exe -canon *3124.cr2

   gives

File Name                       : IMG_3124.CR2

Camera Model Name               : Canon EOS 40D

   ...

Image Size                      : 1936x1288

Quality                         : RAW

   ...

However, this is wrong. The right size is  3888 x 2592.

I suspect 1936x1288 is the size of an embedded jpeg preview?

Indeed, in the following we see some more sizes:

C:\fotos> exiftool -a -u -g1 *3124.cr2

   gives

ExifTool Version Number         : 7.98

File Name                       : IMG_3124.CR2

   ...

---- IFD0 ----

Image Width                     : 1936

Image Height                    : 1288

Bits Per Sample                 : 8 8 8

Compression                     : JPEG (old-style)

   ...

---- ExifIFD ----

   ...

Color Space                     : sRGB

Exif Image Width                : 3888

Exif Image Height               : 2592

   ...

Canon Image Width               : 1936

Canon Image Height              : 1288

AF Image Width                  : 3888

AF Image Height                 : 2592

   ...

Sensor Width                    : 3944

Sensor Height                   : 2622

   ...

---- IFD2 ----

Image Width                     : 486

Image Height                    : 324

   ...

---- Composite ----

Aperture                        : 7.1

Drive Mode                      : Single-frame shooting

File Number                     : 100-3124

ISO                             : 200

Image Size                      : 1936x1288

Archive

[Originally posted by exiftool on 2009-10-30 15:12:54-07]

CR2 is based on the TIFF format, and I use the standard
TIFF rules to obtain the dimensions of the primary image.
What you are seeing is just a by-product of the way Canon
chose to organize their CR2 images (since the JPEG preview
is stored in the main IFD of the image and no other IFD is
marked as the "full-resolution" image).  For CR2 images, you
should look at ExifImageWidth and ExifImageHeight if
you want to see Canon's suggested RAW image size
of 3888x2592.

I say suggested because the 40D sensor is actually
3944x2622 pixels, so you could in theory have an image
as large as this.  But of course, some of this area is affected
by the black mask, so not all is useable.  However, the
useable area is certainly somewhat larger than the 3888x2592
images that Canon produces.  The Apple raw converter
produces 3892x2586 images, and dcraw (which usually
produces the largest images) gives 3908x2602 for the
40D.

I realize this is getting a bit more involved than your
original question, but I mention this so you can understand
that determining the size of a raw image is not as
straightforward as one might think.  However, for your
purposes I imagine that using ExifImageWidth/Height
is sufficient.

- Phil

Archive

[Originally posted by exiftool on 2009-10-30 15:27:04-07]

OK.  Having said all that, maybe I should add a special case for
CR2 images (and derive the ImageSize from ExifImageWidth/Height
for CR2 images only) since this quirk has confused other users in the
past .  I'll think about this.

- Phil

Archive

[Originally posted by krkj on 2009-10-31 10:16:18-07]

That sounds brilliant!