Overview about embedded images

Started by herb, January 16, 2013, 08:34:07 AM

Previous topic - Next topic

herb

Hello Phil,

working with my *.orf and also my *.jpg images I have some experience with embedded images
called -ThumbnailImage, -PreviewImage and -JpgFromRaw.

In thread
https://exiftool.org/forum/index.php?topic=4399.0
I read about an embedded image called -OtherImage.

And reply #6 of thread
https://exiftool.org/forum/index.php?topic=3622.0
I read about an embedded image called -PreviewImage(1).

And to complete my confusion in thread
https://exiftool.org/forum/index.php/topic,4220.15.html
the discussion is about an embedded image inside the -mpf section;
but I do not know how it is called.

Can you please comment on
- how many types of embedded images may exist, and are supported by ExifTool
- how such an embedded image must be addressed in order to be e.g. extracted into a new *.jpg file.

Thanks for your help in advance
Herb

Phil Harvey

Hi Herb,

It would be difficult to answer the question you asked because of the broad scope of your question (do you really mean all embedded images from all supported file types?).

However, the sample config file contains a user-defined Composite "BigImage" tag which returns the largest commonly available preview image (from JPEG and TIFF-format files anyway).

This takes care of all of the common embedded preview images, but ignores the smaller thumbnails.  Does this help?

- 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 ($).

herb

Hello Phil,

thanks for your quick reply.
Yes, it would be very interesting to have such an overview table you mentioned.
But it was never the goal of my question to ask for such a dissertation.

The -BigImage example config-file was very helpful for me. Thanks for it.
I did some tests with the -BigImage tag and learned lots of things:
e.g. that -OtherImage(1) is also a tag - but I did not find where it is defined.

I think I did not get all details of the -BigImage example, because I do not speak Perl.
So please allow some more questions.

- Does -BigImage also cover an embedded image in the -MPF area?
  I suggest it does not, because there is no (composite) tag defined for it.

Let us assume an image has 2 embedded preview images:
(e.g. in IFD0 and also IFD1: I do not know whether this will really exist, but you will see the goal of my question)

- The tag -BigImage will take the larger preview image (=IFD0PreviewImage).
  Is it also possible to extract the other (smaller) preview image?

- Is it possible to define an "user-defined" tag for the -MPF embedded preview image and/or
  for the smaller IFD1PreviewImage in order to extract it?
  I suggest this tag must also be defined internally by ExifTool.

Thanks again for your answers in advance
Herb

Phil Harvey

Quote from: herb on January 17, 2013, 06:12:04 AM
e.g. that -OtherImage(1) is also a tag - but I did not find where it is defined.

Do you mean "PreviewImage (1)"?  I don't know of any file format that contain 2 OtherImage values.  The subscript is used internally to differentiate multiple same-name tags when extracting.  This subscript exists in the tag keys which are accessible via the API:

The tag keys are identifiers, which are similar to the tag names but may have an appended instance number if multiple tags with the same name were extracted from the image.

And also from the family 4 group names that you can see with the -G4 option in the command-line application.

Quote- Does -BigImage also cover an embedded image in the -MPF area?

BigImage does cover the first MPF large thumbnail:

The first MPF "Large Thumbnail" image is extracted as PreviewImage, and the rest of the embedded MPF images are extracted as MPImage#.

Quote- The tag -BigImage will take the larger preview image (=IFD0PreviewImage).
  Is it also possible to extract the other (smaller) preview image?

Yes.  For the general case, it can be done like this:

exiftool -a -G4 -s FILE | grep Binary

This will list all binary-data tags in the file.  (Note: I am using the "grep" utility here, which you probably don't have if you are in Windows.)

Then any of the existing images may be extracted with:

exiftool -COPYNUMBER:TAG -b FILE > out.jpg

- 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 ($).

herb

Hello Phil,

thanks again for your hints and explanations.
Of course I mean "PreviewImage (1)". Sorry for that.

QuoteThe first MPF "Large Thumbnail" image is extracted as PreviewImage ...
means that usually both the PreviewImage (in older sense) and MPImage will not be present in one image file.

Thanks and best regards
Herb


Phil Harvey

Hi Herb,

There is a new option in ExifTool 9.23 that allows you to extract all JPEG previews and thumbnails with a single command:

exiftool -a -b -W pics/%t%c.%s -wext jpg FILE

Note that -W is upper case.  This command writes all contained JPEG images to a "pics" directory.  The files are named according to the tag name, with the extension set by the data type.  The -wext jpg option selects only JPEG-formatted data from the image, so only ".jpg" files will be created. (Without this, every tag in the image would generate an output file, mostly with ".txt" extensions.)

- 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 ($).

cuagn

I've been busy, but I just come back...

I've made the same test than before (https://exiftool.org/forum/index.php/topic,4134.msg23242.html#msg23242).

I was expecting the same result...

No, IT WORKS!  :P

I have the version in the result file
9.20
{ready001}


What has been changed?
Nothing except that I've done the test in a newly rebooted W7Pro 64.
May be this is the reason but why?

I continue...

Phil Harvey

...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 ($).