Versioning - Link Expression formatting

Started by moviemaker445, May 13, 2023, 07:53:28 AM

Previous topic - Next topic

moviemaker445

I am attempting to link a Sony ARW file to a JPG Version.

The filenames are:
Master  = RX6_1670 [2019-09-03 @ 07;56;39]_r.arw
Version = RX6_1670 [2019-09-03 @ 07;56;39]_r(j).jpg

I have set the Master Expression as      \.(arw)$             which Tests as a 'Match!'
But with the Link Expression set as      ^{name}(j).*\.jpg$   it Tests as 'No Match!'

Obviously, there is/are characters missing in the Link.
Can someone help please as I have spent more than an hour on this and got nowhere. :-(
Thanks in advance...


Mario

Do you really use [] and () and @ in file names?

That's a bit special. The general rule is to keep file and folder names simple, using only plain ASCII characters and digits and maybe - or _. Simple naming conventions avoid a lot of problems, especially when you work on multiple platforms and with multiple applications.

Using [] and () in file names makes using regular expressions a bit harder, since both [] and () have special meanings in regular expressions. See Regular Expressions for additional info and pointers.

To make your link regexp handle file names containing ( and ), you need to change it to this:

^{name}\(j\).*\.jpg$

Since ( and ) have a special meaning in regular expressions (they are used to indicate sub expressions), you have to escape both characters with a leading \

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

moviemaker445

Hi Mario. Yes - those characters are contained in all ~100k of my media filenames.
I came up with the naming convention, which is easy for me visually, years ago and, unfortunately, I had no idea that I would ever encounter 'Regular Expressions'. The only character I avoided was ',' which caused problems when I was moving metadata about in CSV files.

I will use the '\' Escape character liberally as required.

Thank you once again for your help and I am still in awe of the amazing power and flexibility you have built into IMatch. It is a 'one of a kind' app!!!

Warm regards
Peter

sinus

I could not help here, but to be honest, I stumbled over the filenames:

The filenames are:
Master  = RX6_1670 [2019-09-03 @ 07;56;39]_r.arw
Version = RX6_1670 [2019-09-03 @ 07;56;39]_r(j).jpg

I thought, are these really filenames? At least for me very strange.
But you will have your reasons or you get the files from someone, what you cannot control.

Cool, that Mario could help, I hope, it works.
Best wishes from Switzerland! :-)
Markus

Mario

Quote from: moviemaker445 on May 13, 2023, 12:50:21 PMI will use the '\' Escape character liberally as required.
This will make your expression work just fine.
Remember: if you want to include a literal ( or ) or [ or ] in your regexp, prefix it with a \ to make this clear to the regular expression parser.

There is no problem per se with your file names, but using special characters like []()@, Unicode characters etc. are prone to cause problems in applications, especially if you work on multiple platforms or with multiple services.

Using the Renamer to strip the special characters may be something to consider when you run into other problems in the future.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

moviemaker445

Hello Mario, using your tips I have been successful in linking Masters and Versions.

However, I am having issues with Metadata information in a Master file being synchronised to a Version file correctly.

I use 24 fields to record information about my media. I want the Version fields to be updated from the Master fields, for all except one (the Title field).

The issue I have discovered is set out in the scenarios below:

1. If my metadata fields in the Version are blank, they are all updated with the contents of the Master file fields correctly.

2. If my metadata fields in the Version have previously been filled from the Master, they are correctly updated for changes in the Master.

3. If the metadata fields in the Version contain an entry that has been added during export from Capture One (image editor), even if it is identical to the entry in the Master, it is not updated.


Scenario 3 results in Versions that have some fields which match the Master and others which do not.

Is there a way to 'force' an update of Version fields from the Master for the thousands of files I have edited in Capture One?
Hopefully there is a simpler solution than having to delete all data in all fileds entered by Capture One.

Mario

IMatch does not care if there is already data in the version.
It just tells ExifTool to copy the tags or tag groups you have configured. It first writes the master, and then copies the data to the version(s).

If this does not work (rarely), there might be side-effects, depending on which tags you copy, how different XMP tags are mapped between other tags, if there is legacy IPTC data and/or EXIF data and dozens of other reasons.
Copying individual tags always bears the risk that some XMP rules kick it and the result does not work out the way the user things because of mapping rules or preexisting metadata in the target file.

This means:
We need to have samples of your master files and versions. We need to know which tags you propagate. We need to see the ExifTool output when you trigger a propagation (change some metadata for the master and then write back). This might something that only happens because of the data you propagate and what's the in the master and version before propagation is performed. Metadata is very, very complex. And C1 always had problems with metadata and sticking to the rules.

Such fringe cases are always a bit of a PITA and take time to analyze (and are thus expensive, from my perspective).
I also always have a backlog of such "my metadata does not work the way I want to", so expect at least one or two weeks after delivering the requested information.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

thrinn

Quote from: moviemaker445 on May 17, 2023, 12:51:29 AMIs there a way to 'force' an update of Version fields from the Master for the thousands of files I have edited in Capture One?
Hopefully there is a simpler solution than having to delete all data in all fileds entered by Capture One.
If you are able to select the masters of these versions, you can explicitly trigger the propagation using the "Propagate data to versions" command which is described under Version Commands in the File Window. This command is only available for files that are masters. There is also a corresponding "Propagate" command which only works on versions, also triggering the propagation from the master to the version. Be aware that this might also trigger a metadata writeback if you are propating "on write" attributes.
Thorsten
Win 10 / 64, IMatch 2018, IMA

moviemaker445

Thank you Thorsten for your suggestion, but unfortunately using the "Propagate data to Versions" command did not work either.

On re-reading Mario's post, the words "if there is legacy IPTC data" caused me to re-examine my settings in the "Preferences > File Relations > Versioning > What to propagate" options box.

My initial setting was (only) to enable "XMP All Data", but once I enabled "Classic IPTC Data (IIM)" as well - the problem disappeared and all metadata was propagated from Master to Version correctly.  :)

PROBLEM SOLVED - THANKS

(This solution has caused another issue which I will raise in new post)

Mario

Strange. IMatch automatically updates legacy IPTC data in the target file from XMP (master and version) unless the corresponding options have been disabled in the metadata settings.
As I said above, without sample files and detailed information, everything is guesswork.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook