Now, that was surprisingly trivial...

Started by Mario, February 28, 2019, 09:32:14 PM

Previous topic - Next topic

Mario

While steaming a bit about spending yet another 30 minutes of my life with analyzing metadata (and finding problems caused by cameras or other software) I 're-had' (for the umpteenst time) the idea of writing a small app that reads metadata via ExifTool and then analyses it for typical issues (like out-of-syn timestamps).

Something modular, which manages tests in a class that can be easily extended by new tests (whenever we identify a new issue to check for).

I though the best way to do it would be to run an instance of ExifTool, let it extract the metadata, write it to a temporary file, read that file with the app etc. ExifTool can do JSON so this should not be hard. In fact, it was much easier, because of the awesome processRun function in the IMatch helper library. For a quick test I did:



and this was all that's needed. When processRun resolves the promise, the JSON data can be read directly from the process output stream into the variable self.jsonData. Since I request the data in JSON format from ExifTool, the app can now immediately start (after  JSON.parse) to check it for problem. This was easy.

Implementing the tests and the UI will take a day or two, but this should be worth it. It may save users (and me!) more time in the long run. Or at least provide better data for analyzing problems reported by users.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Best wishes from Switzerland! :-)
Markus

Tveloso

Mario, that's awesome!  That's going to be an extremely valuable tool...especially for those of us that still have lots of Metadata issues in our files.

Hopefully that will in fact head off some of those support posts related to the standard Metadata problems...it certainly should - with that app, you're basically allowing us to say "Hey IMatch, what's wrong with my files?".  Awesome!
--Tony

sinus

Quote from: Tveloso on March 01, 2019, 04:44:24 AM
Mario, that's awesome!  That's going to be an extremely valuable tool...especially for those of us that still have lots of Metadata issues in our files.

Hopefully that will in fact head off some of those support posts related to the standard Metadata problems...it certainly should - with that app, you're basically allowing us to say "Hey IMatch, what's wrong with my files?".  Awesome!

Exactly ... and it will also give Mario more time that he doesn't have to waste on those things ... hopefully.
Best wishes from Switzerland! :-)
Markus

Mario

#4
One challenge will be to transfer the metadata settings configured by the user (Metadata 1, Metadata 2 and per file format settings) into the app somehow. This requires me to write a new IMWS endpoint.

Without that info, the app can do a static analysis and provide detailed information for debugging. But it cannot really tell what IMatch "sees" when it looks at the file. So this endpoint will have to come first, then the rest. Definitely something on my to-do list for IMatch 2020.

This will easily cover typical problems like out-of-sync metadata, different timestamps in different metadata formats, partial embedded XMP records in RAW files, invalid or corrupted metadata in video files (common problem) etc.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Jingo

Quote from: Mario on March 01, 2019, 09:04:37 AM
One challenge will be to transfer the metadata settings configured by the user (Metadata 1, Metadata 2 and per file format settings) into the app somehow. This requires me to write a new IMWS endpoint.

Without that info, the app can do a static analysis and provide detailed information for debugging. But it cannot really tell what IMatch "sees" when it looks at the file. So this endpoint will have to come first, then the rest. Definitely something on my to-do list for IMatch 2020.

This will easily cover typical problems like out-of-sync metadata, different timestamps in different metadata formats, partial embedded XMP records in RAW files, invalid or corrupted metadata in video files (common problem) etc.

Hmmm - this should ALSO allow us to create an APP then could show a "Before/After" snapshot based on current metadata configuration settings... kind of like a wizard of sorts to be sure your setting are correct and/or what will happen if you change something... neato!

Mario

#6
If you need something like this, you can do it already.
Or just use the ECP and do two "List Metadata" and then use a Diff text tool to compare the two outputs. No special tool needed.
The app would have to implement something similar anyway. Taking a snapshot of the data. Then allowing the user to take another snapshot of the file and then comparing and visualizing the results. I'm not quite sure many users will ever need this. And for those who do, running ExifTool twice and doing a diff should be sufficient...

exiftool -all:all -json "file.jpg" > before.json
...
update file
...
exiftool -all:all -json "file.jpg" > aftter.json

Then run diff and compare "before.json" with "after.json"
Super simple, works great. Many options (because of ExifTool, e.g. just looking at IPTC or XMP or GPS or EXIF or ...).
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook