ExifTool Forum

General => Metadata => Topic started by: juju22 on November 12, 2012, 12:35:51 AM

Title: Compare two directories ?
Post by: juju22 on November 12, 2012, 12:35:51 AM
Hello,

I check the thread to compare/diff two files (https://exiftool.org/forum/index.php?topic=3276.0) but I'm looking on a way to compare 2 directories (recursive or not)


exiftool /home/julien/Images/20110727 /media/Echange-Ext4/tmp/ImagesA1/20110727/ -w! /tmp/%f.%e.txt

problem of this code, it generates a txt file per image file ...to do a diff, I would prefer one per directory.

For now, I use alternate option

exiftool "$1" > /tmp/$B1.txt
exiftool "$2" > /tmp/$B2.txt
diff -d -y --left-column /tmp/${B1}.txt /tmp/${B2}.txt  | less -i

Nice alternative to diff with gui as it can be quiet big: meld
Problem exiftool output is not consistent between listing. don't know if there is a way to sort files meta (alphabetical, ctime, atime, ...)

A side question, is there any meta time meta which recorded last modified/access/changed of meta ? would say not
But as I have parts of my pictures which are archived and only kept smaller jpg, I would want to track the little update I do to report them when I can.
Title: Re: Compare two directories ?
Post by: Phil Harvey on November 12, 2012, 07:13:38 AM
Quote from: juju22 on November 12, 2012, 12:35:51 AM
Problem exiftool output is not consistent between listing. don't know if there is a way to sort files meta (alphabetical, ctime, atime, ...)

You could try the -sort option. ;)

QuoteA side question, is there any meta time meta which recorded last modified/access/changed of meta ? would say not
But as I have parts of my pictures which are archived and only kept smaller jpg, I would want to track the little update I do to report them when I can.

There is an XMP MetadataDate tag that you could use.

- Phil
Title: Re: Compare two directories ?
Post by: juju22 on November 13, 2012, 06:02:56 PM
Quote from: Phil Harvey on November 12, 2012, 07:13:38 AM
Quote from: juju22 on November 12, 2012, 12:35:51 AM
Problem exiftool output is not consistent between listing. don't know if there is a way to sort files meta (alphabetical, ctime, atime, ...)

You could try the -sort option. ;)

ooops ... didn't see this one. nice !

Quote from: Phil Harvey on November 12, 2012, 07:13:38 AM
QuoteA side question, is there any meta time meta which recorded last modified/access/changed of meta ? would say not
But as I have parts of my pictures which are archived and only kept smaller jpg, I would want to track the little update I do to report them when I can.

There is an XMP MetadataDate tag that you could use.

Cool, will explore that but it seems digikam is not using/filling it ...
Title: Re: Compare two directories ?
Post by: juju22 on November 21, 2012, 02:49:15 PM
coming back on this ... -sort doesn't seem to help.
Exiftool is 8.97-precise~ppa1 from lubuntu 12.04

from manpage

...
-sort                            Sort output alphabetically
...
-sort
            Sort output by tag description, or by tag name if the -s option is used.  Tags are sorted within each group
            when combined with the -g or -G option.  When sorting by description, the sort order will depend on the -lang
            option setting.  Without the -sort option, tags appear in the order they were specified on the command line,
            or if not specified, the order they were extracted from the file.


so it seems it doesn't sort output base on filename alphabetical or on createdate or else :(
confirmed with different output between

exiftool <condition> -sort <files>
exiftool <condition> <files> | sort

Title: Re: Compare two directories ?
Post by: Phil Harvey on November 21, 2012, 02:55:32 PM
Sorry, I thought you wanted to sort the output tag names, but it sounds like maybe you want to sort the order of processing of the input files.  If so, you can do this with the -fileorder option.

- Phil