ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: StarGeek on February 14, 2025, 11:01:31 AM

Title: Possible problem with the -diff option
Post by: StarGeek on February 14, 2025, 11:01:31 AM
I don't know if this is a problem or not, but something I found while trying to use -diff on two XML files created by exiftool (see here (https://exiftool.org/forum/index.php?msg=91429)).

First I ran
exiftool_13.13\exiftool -listx -s >temp1.xml

Then this, which is ver 13.19
C:\>exiftool  -listx -s >temp2.xml

Then this
C:\>exiftool -diff temp2.xml temp1.xml

Exiftool quickly returned the differences in the file system tags, but then nothing else. I had to cancel the command after about ½ hour, though there didn't seem to be a problem with taking up too much memory.
Title: Re: Possible problem with the -diff option
Post by: FrankB on February 14, 2025, 12:11:42 PM
Being curious I tried to reproduce it. And succeeded! If it helps, naming the files temp1/2.txt in stead of temp1/2.xml returns instantly. But that doesn't produce anything other than the System tags either.

EDIT: Comparing an XML with an exact copy but a different name, gives the same result.
Title: Re: Possible problem with the -diff option
Post by: StarGeek on February 14, 2025, 12:30:45 PM
Quote from: FrankB on February 14, 2025, 12:11:42 PMBeing curious I tried to reproduce it. And succeeded! If it helps, naming the files temp1/2.txt in stead of temp1/2.xml returns instantly. But that doesn't produce anything other than the System tags either.

Yes, because in that case exiftool is treating it as a text file, not an XML file. And text files don't have very many tags. Just [File]/[System] tags, nothing embedded.

What I was trying to do here was get a list of all the tags that changed between one version of exiftool and the other. See the thread I linked to.

By succeeded, do you mean you got the diff between two text files or between two XML files.
Title: Re: Possible problem with the -diff option
Post by: FrankB on February 14, 2025, 12:37:23 PM
Quote from: StarGeek on February 14, 2025, 12:30:45 PMYes, because in that case exiftool is treating it as a text file, not an XML file.

And that would give Phil maybe a hint where to start looking.

Quote from: StarGeek on February 14, 2025, 12:30:45 PMBy succeeded, do you mean you got the diff between two text files or between two XML files.

No. I meant succeeded in reproducing the behaviour.

Title: Re: Possible problem with the -diff option
Post by: Phil Harvey on February 14, 2025, 01:58:11 PM
The problem is that the -diff logic isn't very efficient, especially for duplicate tags, and there are a large number of duplicate tags in this output (nearly 30000 tags named TaginfoTableTagId for example).  I can't predict how long it would take to compute the entire diff, but certainly a long time.  I don't think it is hanging (it isn't for me).  Maybe I can make this more efficient, but the output would be non-helpful in this case.

- Phil
Title: Re: Possible problem with the -diff option
Post by: StarGeek on February 14, 2025, 02:06:29 PM
No worries then. I just wasn't sure if there was a problem or not.