FReq: Extracting all previews in one go / comparing metadata directly

Started by Beholder3, June 19, 2012, 07:21:25 AM

Previous topic - Next topic

Beholder3

Hello,

surprisingly I do propose two feature requests for exiftool:

       
  • An option to have exiftool directly compare image metadata of two given files and dump differences into a textfile
    e.g. exiftool -compare IMAGE1.JPG IMAGE2.JPG differences.txt
  • An option to have exiftool dump all JPG preview / thumbnail files in an image, regardless of size and number
    e.g. [/color]exiftool -extractallpreviews IMAGE1.JPG
All currently can be achieved as has been discussed, but it involves some user interaction and shell commands to do so. Since I like automation these sound like valid feature requests.  :)

Phil Harvey

Request 1 is interesting, and would be a whole new functionality, but may be a bit beyond the scope of the exiftool application.

Request 2 would require extracting multiple binary values to different files.  I have toyed with this idea:

exiftool "-thumbnailimage>=%f_thumb.jpg" "-previewimage>=%f_preview.jpg" "-jpgfromraw>=%f_jfr.jpg" -b FILE

Which is the inverse of the "<=" syntax.  Would this do what you want?

I seem to recall a stumbling block that prevented me from implementing this, but I can't remember the details right now.

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

Beholder3

I just ran
"-thumbnailimage>=%f_thumb.jpg" "-previewimage>=%f_preview.jpg" "-jpgfromraw>=%f_jfr.jpg" -b
in exiftoolGUI on a DNG file and it did nothing helpful. The output was
QuoteWarning: Tag 'thumbnailimage>' does not exist
Warning: Tag 'previewimage>' does not exist
Warning: Tag 'jpgfromraw>' does not exist
Nothing to do.
<-END-

Any other ideas?

Phil Harvey

Sorry if I confused you.  The example command I gave is how this feature could work in theory if you thought it would be useful, but this feature doesn't exist yet (as of version 8.95).

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

Beholder3

Ah, ok, I thought this could be a kind of long workaround command.

I am not so sure it would actually work well on DNGs. If I interpret exiftools output correctly there are two items stored under the "title" "previewimage" in the DNG. The smaller 640 x 480 pixel one and the full size.
I guess you would need to add one fourth item for the "BigImage" content as well to grab the fullsize preview from a DNG.
And I dont know how to avoid it that the previewimage grabs the large preview instead of the 640 x 480 as this could lead to have the fullszie preview extracted twice and the 640 x 480 not at all as "thumbnail" and "jpgfromraw" is not in the DNG at all.

Phil Harvey

In the case where 2 PreviewImage tags are present, they can be accessed individually with -previewimage and -copy1:previewimage, provided you don't have duplicates enabled.

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

BogdanH

That did the trick, Phil!
Too bad, I will remember that only till tomorrow...

Bogdan

Beholder3

Quote from: Phil Harvey on June 19, 2012, 12:31:21 PM
In the case where 2 PreviewImage tags are present, they can be accessed individually with -previewimage and -copy1:previewimage, provided you don't have duplicates enabled.

Is there a way to run that in one single command?

I tried -b -previewImage -w %d%f_640x480.jpg -copy1:previewImage -w %d%f_4928x3264.jpg and it didnt work.

Phil Harvey

Currently you can not output the values of different tags to different files.  The -w option writes only one output file per image file.

- 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

ExifTool 9.23 adds the functionality to allow multiple binary tags to be extracted from a single image.  To extract all JPG thumbnails and previews, a command like this may be used:

exiftool -a -b -W %d%f_%t%c.%s -wext jpg DIR

(Note that -W is upper case.)

And by adding the -ee option, this will also extract embedded JPG images from PDF 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 ($).