Author Topic: Now, that was surprisingly trivial...  (Read 333 times)

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 22271
Now, that was surprisingly trivial...
« on: February 28, 2019, 09:32:14 PM »
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.
« Last Edit: February 28, 2019, 09:36:05 PM by Mario »

sinus

  • Global Moderator
  • *****
  • Posts: 3587
  • IMatch-User since 2001 (IMatch 3.6)
Re: Now, that was surprisingly trivial...
« Reply #1 on: February 28, 2019, 10:43:16 PM »
 :D

super! Looks very useful!
Best wishes from Switzerland! :-)
Markus

Tveloso

  • New Members
  • *
  • Posts: 17
Re: Now, that was surprisingly trivial...
« Reply #2 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!

sinus

  • Global Moderator
  • *****
  • Posts: 3587
  • IMatch-User since 2001 (IMatch 3.6)
Re: Now, that was surprisingly trivial...
« Reply #3 on: March 01, 2019, 08:33:44 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

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 22271
Re: Now, that was surprisingly trivial...
« Reply #4 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.
« Last Edit: March 01, 2019, 09:20:11 AM by Mario »

Jingo

  • Super Hero
  • ****
  • Posts: 1036
Re: Now, that was surprisingly trivial...
« Reply #5 on: March 01, 2019, 02:10:03 PM »
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

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 22271
Re: Now, that was surprisingly trivial...
« Reply #6 on: March 01, 2019, 03:46:06 PM »
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 ...).
« Last Edit: March 01, 2019, 03:49:19 PM by Mario »