ExifTool diff feature

Started by greybeard, October 19, 2024, 12:22:46 PM

Previous topic - Next topic

greybeard

Introduced in version 12.99 the new ExifTool diff feature is really helpful in comparing the metadata from two files. As an example - this compares the Fujifilm MakerNotes from two image files.

In the past you would have to run two Exiftool commands and use an operating system command (or another utility) to compare the output:

exiftool -a -G1 -u -Fujifilm:All -diff FFFF0019.JPG FFFF0019.RAF

======== diff < FFFF0019.RAF > FFFF0019.JPG
   FujiFilm       (84 same tags)
< [FujiFilm]      Quality                         : NORMAL
>                                                 : FINE
< [FujiFilm]      Focus Pixel                     : 2053 1341
>                                                 : 2901 1895
< [FujiFilm]      Face Element Positions          : 1496 711 2833 2209 1683 787 2703 2202 1924 1395 2012 1476
>                                                 : 2115 1005 4005 3123 2379 1113 3821 3113 2720 1972 2845 2088
< [FujiFilm]      Fuji Film 0x4204                : 22201 15827 42043 49174 24976 17519 40114 49018 28553 3[...]
>                                                 : 22212 15832 42062 49199 24985 17534 40130 49041 28566 3[...]

FrankB

Agree. Already created in issue to add this functionality to ExifToolGUI.

greybeard

Yes - I had already written a version of this for my MacOS GUI application based on the Apple diff function but probably would have used this ExifTool native function instead.

Phil Harvey

I'm glad you found this feature already.

Just a small note:  You don't need -a -G1 because these are the default for -diff

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

FrankB

I'm trying to 'put myself into the shoes of an average GUI user' and image what would be useful. I can think of 2 scenario's.

1) Compare 2 files, possibly, but not necesarilly, in the same directory.
2) Compare 2 directories, with matching filenames.

Maybe, just maybe because it might not always be possible, create a function to 'merge' the differences found.

Am I missing something?

Thanks in advance,
Frank

Phil Harvey

Hi Frank,

Sounds good.

I would guess that comparing a whole directory would be uncommon, but easy to implement so why not.

Merging differences sounds difficult, and as you said it wouldn't always be possible (some of the different tags may not be writable).

- 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

Note that in version 13.00 the "same tags" lines will be output only with the -v option (as I had originally intended, and as mentioned in the documentation).

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

FrankB

Thanks.

As I see it 'merging' would be a 3 phase process. 1) Compare 2) Create ExifTool commands to do a 'TagsFromFile' from Left->Right, or Right->Left for the differences found.  3) Execute those commands.


I'm still just brainstorming. Dont expect something soon, but it's on my list.