Image file in the IFD2 of a CR2 file

Started by OzanK, April 25, 2015, 09:50:13 AM

Previous topic - Next topic

OzanK

Is there any command for extracting the image file in the IFD2?
By the way, it is a JPEG as well?
Thanks.

Phil Harvey

Yes, but you must first determine the tag name for the image.  You can look at the IFD2 tags to see what the image is called:

exiftool -ifd2:all -a FILE

And the image itself will be a Composite tag derived from the offset/length tags in IFD2.  (Either PreviewImage, JpgFromRaw, ThumbnailImage or OtherImage.)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

OzanK

Image Width                     : 668
Image Height                    : 432
Bits Per Sample                 : 16 16 16
Compression                     : Uncompressed
Photometric Interpretation  : RGB
Strip Offsets                      : 2443852
Samples Per Pixel              : 3
Rows Per Strip                  : 432
Strip Byte Counts              : 1731456
Planar Configuration          : Chunky
SRaw Type                       : 3


Thank you Phil ...
IFD2 has these tags,
It is a small, uncompressed RGB of the original raw data.

I'm using ExifTool as a command line utility on Windows and I don't know Perl.
Is there any easy way for me for deriving a new composite tag?

Phil Harvey

You don't have to know Perl to use ExifTool.

But this embedded image isn't JPEG, so I'm afraid you are out of luck.  ExifTool only extracts the JPEG-format images from these files.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

OzanK

As far as I know new composite tags are defined with the config file.
I use Windows executable ... can I add new composite tags from the command line?
If so ... do we have any tutorial about this?

By the way, any idea about why Canon puts smaller, uncompressed raw data in IFD2?

Phil Harvey

This small image is likely used when reviewing pictures on the camera's LCD monitor.

I don't understand what you are trying to achieve with the Composite tag.  You want to just extract the RGB data as a binary block?  It won't be displayable by anything.  To create a viewable image from this data would take some work.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

OzanK

I asked it for general use, not for extracting the RGB data.
If there is a way for defining new composites from the command line, I would like to learn it.
Thanks a lot.

Phil Harvey

Oh, sorry.

Creating user-defined tags does take a bit of Perl knowledge.  This is done via a config file.  The sample config file contains a number of examples of how to create new Composite tags.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

OzanK