Possible problem with the -diff option

Started by StarGeek, February 14, 2025, 11:01:31 AM

Previous topic - Next topic

StarGeek

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

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.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

FrankB

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.

StarGeek

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.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

FrankB

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.


Phil Harvey

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

StarGeek

No worries then. I just wasn't sure if there was a problem or not.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype