ExifTool Forum

ExifTool => Newbies => Topic started by: cohosalmon on February 21, 2015, 07:01:50 PM

Title: extracting multi-picture format thumbnails from a jpeg
Post by: cohosalmon on February 21, 2015, 07:01:50 PM
Hi
I am using windows and the exiftool binary (9.85). When I run exiftool on my jpeg image, I see several references to mp image including "MP Image Length".  I have read the command line documentation and find references to multi-picture format but I cannot find the exiftool syntax to extract the mp images from my jpg file (created with a Panasonic camera). I did find mpf.pm which looks like it might do the job, but I don't see how to use that with the windows exiftool binary version.

Any suggestions?

Thank you.
Title: Re: extracting multi-picture format thumbnails from a jpeg
Post by: Phil Harvey on February 21, 2015, 09:22:24 PM
The technique to extract all images is the same:

1) Use "exiftool -s FILE" to see what tags are available.  The images will appear with values like "(Binary data XXX bytes, use -b option to extract)".

2) With the appropriate tag name from above, use this command to extract the binary data to file:

exiftool -TAG -b FILE > OUTFILE

where TAG is the name of your MP image tag, FILE is the name of your input JPG file, and OUTFILE is the name of the output image file.

- Phil
Title: Re: extracting multi-picture format thumbnails from a jpeg
Post by: cohosalmon on February 22, 2015, 02:27:05 AM
Thank you, Phil, both for your answer and your excellent program!

So I ran the following command
exiftool -S p1020284.jpg

and these were the entries which had "use -b option to extract"
DataDump: (Binary data 8200 bytes, use -b option to extract)
PreviewImage: (Binary data 999494 bytes, use -b option to extract)
ThumbnailImage: (Binary data 9008 bytes, use -b option to extract)

I have previously extracted the ThumbnailImage using your suggested syntax
exiftool -ThumbnailImage -b FILE > OUTFILE
and the PreviewImage
exiftool -b -PreviewImage p1020284.jpg > preview.jpg
which creates a 1440 x 1080 image

But I believe that there are additional images embedded in the jpeg which Panasonic uses to display previews on the camera LCD. I think they may be related to some of this EXIF information:

MPFVersion: 0100
NumberOfImages: 2
MPImageFlags: Dependent child image
MPImageFormat: JPEG
MPImageType: Large Thumbnail (full HD equivalent)
MPImageLength: 999494
MPImageStart: 5313536
DependentImage1EntryNumber: 0
DependentImage2EntryNumber: 0


But as you can see, there is no "use -b option to extract" suggestion associated with these tags.


So, after all this, I realize that I am really asking questions about EXIF and the Multi-Picture Format specification.

So I looked at
http://www.cipa.jp/std/documents/e/DC-007_E.pdf
But I am still not sure.

I am wondering if I am barking up the wrong tree. But your MPF.pm perl module does seems to deal with this.

I have attached the entire exiftool -S output to this reply

Thank you for any suggestions.


Title: Re: extracting multi-picture format thumbnails from a jpeg
Post by: cohosalmon on February 22, 2015, 02:40:24 AM
I just noticed something from the EXIF data:

PreviewImage: (Binary data 999494 bytes, use -b option to extract)
where
exiftool -b -PreviewImage p1020284.jpg > preview.jpg
creates a 1440 x 1080 image

and

MPImageLength: 999494

these two images having the same length cannot be a coincidence. Does exiftool process the MPImage as the PreviewImage?

thanks

UPDATE 2/22/2015 0004hr PST

just found
http://search.cpan.org/~exiftool/Image-ExifTool-9.60/lib/Image/ExifTool/MPF.pm
which points to:
http://search.cpan.org/~exiftool/Image-ExifTool-9.60/lib/Image/ExifTool/TagNames.pod#MPF_Tags

which says:
MPF MPImage Tags

The first MPF "Large Thumbnail" image is extracted as PreviewImage, and the rest of the embedded MPF images are extracted as MPImage#. The ExtractEmbedded (-ee) option may be used to extract information from these embedded images.

  Index1   Tag Name                             Writable
  ------   --------                             --------
    0.1    MPImageFlags                         N
    0.2    MPImageFormat                        N
    0.3    MPImageType                          N
      4    MPImageLength                        N
      8    MPImageStart                         N
     12    DependentImage1EntryNumber           N
     14    DependentImage2EntryNumber           N


however I was not able to get information from MPImage# using -b or -ee
for example, none of the following produced any information output
exiftool -ee -MPImage# p1020284.jpg
or
exiftool -ee -MPImage1 p1020284.jpg
or
exiftool -ee -MPImage p1020284.jpg

Does anyone have any thoughts about this?
thanks
Title: Re: extracting multi-picture format thumbnails from a jpeg
Post by: Phil Harvey on February 22, 2015, 09:31:28 AM
Yes, the ExifTool MPF tag name documentation (https://exiftool.org/TagNames/MPF.html) is the place to go to read about how ExifTool handles this.

It sounds like there is only one MP image in your file, and that this is called PreviewImage by ExifTool.

The MPF:NumberOfImages is 2 in your output, but I think they count the main image as one.

- Phil