Image with 2 preview images

Started by herb, September 12, 2013, 12:07:02 PM

Previous topic - Next topic

herb

Hallo Phil,

I was looking for some example images that contain MPF tags and images.
I found such a file on dpreview http://www.dpreview.com/reviews/Nikon-D800-D800e/samples/diffraction/f4-9588.jpg

For this image exiftool -all:all reports 2 preview-images - one is 852178 byte and the other is 21750 byte long.
In addition also a thumbnail image is reported with length 8946 byte.

(1)
The thumbnail image can be exported e.g. with:       exiftool -b -thumbnailimage -w! "F:\%f.jpg_thumb" F:\f4-9588.jpg
The large preview image can also be exported with: exiftool -b -previewimage   -w! "F:\%f.jpg_prev"    F:\f4-9588.jpg

Is it possible also to export the 2nd preview image and which tagname has to be used?
I tried with -previewimage(1), -otherimage, -otherimage(1), -mpimage and many others without success.

(2)
When I display all tags with exiftool -g0 -all:all
   the large preview image is listed in section File and
   the smaller preview image is listed in section Composite

When I display all tags with exiftool -g1 -all:all
   both preview images are listed in section Composite

What causes this difference in exiftool output?

I am working with standalone verion of Exiftool 9.36 on a Windows XP system.

Thanks for your comments in advance
Best regards
Herb

Phil Harvey

Hi Herb,

The new -W option may be used to export all of the images in a single command, something like this:

exiftool "-*image" -W %d/%f-%t%c.%s DIR

Alternatively, to access the 2nd PreviewImage by itself, specify -copy1:previewimage.

About the difference in the groups... Interesting.  I'll look into this.

- 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.
The command: exiftool -b -copy1:previewimage ... works perfect.

But to my surprise the file has 833 KB while exiftool reports only 21750 byte.

Thanks in advance again
Best regards
Herb

Phil Harvey

Hi Herb,

This behaves as expected for me:

> exiftool tmp/f4-9588.jpg -previewimage -G4 -a
[Copy1]         Preview Image                   : (Binary data 852178 bytes, use -b option to extract)
[]              Preview Image                   : (Binary data 21750 bytes, use -b option to extract)

> exiftool tmp/f4-9588.jpg -previewimage -b >a.jpg
> ls -l a.jpg
-rw-r--r--  1 phil  staff  21750 Sep 12 12:53 a.jpg

> exiftool tmp/f4-9588.jpg -copy1:previewimage -b > b.jpg
> ls -l b.jpg
-rw-r--r--  1 phil  staff  852178 Sep 12 12:53 b.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 ($).

Phil Harvey

I've found and fixed the problem with the group names.  This fix will appear in version 9.37.

Thanks for pointing this out.  You get a gold star for finding an ExifTool bug. :)

- 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 investigations and thanks for the correction you will do in 9.37. The gold star of course gets a place of honour.

I regret, but on my windows XP SP3 system I get the following output in DOS-box:
C:\Fototools\Exiftool>dir f:\tmp\f4*
Datenträger in Laufwerk F: ist Work
Volumeseriennummer: D8FD-D54E
Verzeichnis von f:\tmp
12.09.2013  17:08        18.055.434 f4-9588.jpg
               1 Datei(en)     18.055.434 Bytes
               0 Verzeichnis(se), 42.539.675.648 Bytes frei
C:\Fototools\Exiftool>c:\fototools\exiftool\exiftool -b -previewimage f:\tmp\f4-9588.jpg > f:\tmp\prev.jpg
C:\Fototools\Exiftool>c:\fototools\exiftool\exiftool -b -copy1:previewimage f:\tmp\f4-9588.jpg > f:\tmp\prev1.jpg
C:\Fototools\Exiftool>dir f:\tmp
Datenträger in Laufwerk F: ist Work
Volumeseriennummer: D8FD-D54E
Verzeichnis von f:\tmp
13.09.2013  10:45    <DIR>          .
13.09.2013  10:45    <DIR>          ..
12.09.2013  17:08        18.055.434 f4-9588.jpg
13.09.2013  10:45           873.928 prev.jpg
13.09.2013  10:45           852.178 prev1.jpg
               3 Datei(en)     19.781.540 Bytes
               2 Verzeichnis(se), 42.537.943.040 Bytes frei

Sorry it is in German; but you can see that both export files have similar the same size of 850 and 830 KB.
Which information do you need in addition to solve this miracle?


In addition I have some questions to embedded images:

(1) Inside the config file I found a composite tag called PreviewImage(1).
Is the output of exiftool -b -copy1:previewimage this PreviewImage(1)?
In case of "No" what is PreviewImage(1) exactly?

(2) On your Composite Tags page a composite tag -MPImage is defined which depends on -MPImageStart, -MPImageLength and -MPImageType.
For the image f4-9588.jpg these tags exist, but the -MPImage tag is not displayed in Composite section of output.
I also tried to export it with command: exiftool -b -MPImage f:\tmp\f4-9588.jpg >f:\tmp\mpi.jpg
but nothing is exported.
Is it because -MPImage is THE Main-Image itself?

(3)When I display all tags I get the following output for MPF tags:
---- MPF0 ----
MPF Version                     : 0100
Number Of Images                : 2
---- MPImage1 ----
MP Image Flags                  : Representative image, Dependent parent image
MP Image Format                 : JPEG
MP Image Type                   : Baseline MP Primary Image
MP Image Length                 : 17223650
MP Image Start                  : 0
Dependent Image 1 Entry Number  : 2
Dependent Image 2 Entry Number  : 0
---- MPImage2 ----
MP Image Flags                  : Dependent child image
MP Image Format                 : JPEG
MP Image Type                   : Large Thumbnail (full HD equivalent)
MP Image Length                 : 852178
MP Image Start                  : 17203256
Dependent Image 1 Entry Number  : 0
Dependent Image 2 Entry Number  : 0


Please allow a more theoretical question: (it is theoretical, because I have no such file)
Let us assume that we have found 4 MPF images instead of 2.
MPImage1 is THE Main-Image itself.
MPImage2 is handled as a PreviewImage.
The others will be handled as MPImage#. But what does MPImage# mean?
How do I have to export them?
Is it:  exiftool -b -copy2:MPImage and exiftool -b -copy3:MPImage ?


Thanks for you comments in advance
Best regards
Herb

Phil Harvey

#6
Quote from: herb on September 13, 2013, 05:40:05 AM
I regret, but on my windows XP SP3 system I get the following output in DOS-box:

The OS won't make a difference.  What version of ExifTool?

Quote(1) Inside the config file I found a composite tag called PreviewImage(1).
Is the output of exiftool -b -copy1:previewimage this PreviewImage(1)?

Are you using this config file?  Another PreviewImage would cause the difference above.  Or do you mean the "PreviewImage (1)" referenced from the Composite BigImage tag?  If the latter, then the answer is yes.

MPFImage# means MPFImage2, MPFImage3, etc.  The image with start 0 (the main image) is not extracted as a separate MPFImage# tag.

- 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. You are great you found the file-size problem.

Yes I use Exiftool 9.36 together with an .exiftool_config file that contains the entry for -BigImage tag.
I disabled the config file and everythings works fine.
Now I am very astonished, how the -BigImage entry could cause this problem.
I used -BigImage because this feature is nice to have. On the other hand I suggest there is no generic -BigImage solution that does not cause the file-size problem.


You explained that -MPImage# starts with -MPImage2.
Would it not be better to have the output in the previous post as
---- MPF ---- instead of MPF0
MPF Version                     : 0100
Number Of Images                : 2
---- MPImage or MPImage0 ---- instead of MPImage1
MP Image Flags                  : Representative image, Dependent parent image
MP Image Format                 : JPEG
MP Image Type                   : Baseline MP Primary Image
MP Image Length                 : 17223650
MP Image Start                  : 0
Dependent Image 1 Entry Number  : 2
Dependent Image 2 Entry Number  : 0
---- MPImage1 ---- instead of MPImage2
MP Image Flags                  : Dependent child image
MP Image Format                 : JPEG
MP Image Type                   : Large Thumbnail (full HD equivalent)
MP Image Length                 : 852178
MP Image Start                  : 17203256
Dependent Image 1 Entry Number  : 0
Dependent Image 2 Entry Number  : 0


Thanks again and Best regards
Herb

Phil Harvey

Hi Herb,

I use the sample config file here, including BigImage, and it doesn't mess me up.  So I still don't understand why the difference on your system.

I can't rename the MPImage tags because the images may be in any order -- the main image doesn't need to come first.

- 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,

in my previous test I only worked with and without .exiftool_config file.
Now I found that the file-size problem is caused by "Duplicates" line of config file entry
# Specify default ExifTool option values
# (see the Options function documentation for available options)
%Image::ExifTool::UserDefined::Options = (
    CoordFormat => '%.6f',  # change default GPS coordinate format
    Duplicates => 1,        # make -a default for the exiftool app
    GeoMaxHDOP => 4,        # ignore GPS fixes with HDOP > 4
);


After disabling this line all works fine.

Maybe this will help you.
Thanks again and best regards
Herb

Phil Harvey

Ah, right.  This will make a difference because I forgot to put -a in the commands to extract the images.

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