photools.com Community

IMatch Bug Reports and Feature Requests => Bug Reports => Solved Bug Reports (for next version) => Topic started by: MrPete on March 26, 2024, 08:59:56 PM

Title: Tag Selector: Metadata Mechanic vs Metadata Template. Latter is busted.
Post by: MrPete on March 26, 2024, 08:59:56 PM
If I access Tag Selector in Metadata Mechanic, ALL tags are visible (ie click ... at right edge)

In Metadata Template -> Edit -> New -> Add (tag)...

Seemingly random but it is not -- it is 100% same every time...
For any given set of top level tag groups, 

Examples: apple, sanyo, samsung, app12, xmp

On those, a few that have no tags visible:
Title: Re: Tag Selector: Metadata Mechanic vs Metadata Template. Latter is busted.
Post by: Mario on March 26, 2024, 10:16:13 PM
Probably you have enabled the "Show only tags with data" option. Let us know.
Title: Re: Tag Selector: Metadata Mechanic vs Metadata Template. Latter is busted.
Post by: MrPete on March 27, 2024, 02:34:44 AM
Nope. As I noted, checkboxes don't matter. (And, I do have data in those elements ;) )
Title: Re: Tag Selector: Metadata Mechanic vs Metadata Template. Latter is busted.
Post by: MrPete on March 27, 2024, 03:40:06 AM
Here's a debug log the general sequence I followed:
* Opened Metadata Template settings, and explored, demonstrating the bug (see also screen caps below)
* Went to Metadata Mechanic and demonstrated no issue
* Picked a file that has app12 PictureInfo tags and showed that it's a problem even with tags (even though it shouldn't be an issue)
* Closed iMatch

And, you'll be happy to know the startup is clean, now that I'm using paid, current, iMatch ;)

Thanks!
Pete
tag select missing groups.pngHere's tag select in m'data template

tag select is fine in M mgr.pngand here in m'data mechanic
Title: Re: Tag Selector: Metadata Mechanic vs Metadata Template. Latter is busted.
Post by: Mario on March 27, 2024, 09:07:35 AM
In MD templates you select a tag to write to. The tag selector does not show tags marked as read-only by ExifTool.
This is probably not respected when the MDM opens the tag selector. I will correct that.
Title: Re: Tag Selector: Metadata Mechanic vs Metadata Template. Latter is busted.
Post by: Mario on March 27, 2024, 09:26:10 AM
I have fixed the issue in the MDM app. It now no longer allows to select read-only tags.
Title: Re: Tag Selector: Metadata Mechanic vs Metadata Template. Latter is busted.
Post by: MrPete on March 28, 2024, 01:13:47 AM
Hmmm... unless I am missing something (VERY likely! ;) ), now that I understand these tools, neither MM nor MT appears to do what I really need.

How close can I get to a relatively simple workflow, something like (Pete's awful pseudocode follows):

* When importing an image file (eg "Add folder")

Filter: if tag.exists(app12::PictureInformation:DateTimeOriginal) {
       Exif:DateTimeOriginal = app12::PictureInformation:DateTimeOriginal;
       Exif:Make = Olympus
       Exif:Model = D500-L
      }

I saw that Phil Harvey suggested this as an ExifTool command for a folder of such files:

Quoteexiftool "-exif:all<all" "-thumbnailimage" -make=Olympus -model=D-500L DIR
(and presumably iMatch sees that and fills in its own database, plus prepares to rewrite the data out to the files as an update?)
Title: Re: Tag Selector: Metadata Mechanic vs Metadata Template. Latter is busted.
Post by: Mario on March 28, 2024, 08:45:58 AM
You can do that with a Metadata Template easily enough.
You can't just wrap everything in an if, you need the if condition for each value you assign.

Some comments:

DO NOT set physical EXIF tags directly. Always use their corresponding XMP tags. Else write-back may wipe out your changes. Use {File.MD.XMP::photoshop\DateCreated\DateCreated\0} and {File.MD.XMP::xmp\CreateDate\CreateDate\0} and similar. See How IMatch uses Date and Time Information (https://www.photools.com/help/imatch/how-imatch-uses-date-and-time.htm?dl=hid-1)

EXIF Make and Model are not recommended for writing and ExifTool explicitly mentions that these tags should not be touched because many RAW processors rely on them and getting them wrong will cause process issues and other problems.

You you know how to use ExifTool. you can run ExifTool from an IMatch favorite to manipulate metadata directly. See External Tool Favorites (https://www.photools.com/help/imatch/fav_basics.htm#a_extcmd?dl=extcmd). Make sure you have written-back before to not lose metadata.

To check if a tag exists / has a value, you can use hasvalue:Text  (https://www.photools.com/help/imatch/var_basics.htm?dl=h-203)and as explained in the help, you combine this with default to create if / then / else expressions with variables.

This variable emits YES when the tag has a value, else NO

{File.MD.APP12::PictureInfo\TimeDate\DateTimeOriginal\0|hasvalue:YES;default:No Value}

In your case, you would return the correctly formatted (YYYY-MM-DD HH:MM:SS) PictureInfo timestamp in the YES case, and the existing EXIF DateTimeOriginal in the NO case. Just replace YES and NO in the variable with the corresponding variables.
Since you're a developer, I'll leave that up to you. The Variables (https://www.photools.com/help/imatch/var_basics.htm?dl=hid-1) help topic has all the info and the VarToy app allows you to try this out interactively.