A clever relation for Raws-jpgs and jpgs-jpgs

Started by sinus, May 02, 2019, 03:21:47 PM

Previous topic - Next topic

sinus

Hi all,
A long time use simply Raw (nef)-versioning:

Master-expression: \.(nef|NEF|dng|DNG)$
Link expression: ^{name}:21.*\.(jpg|JPG|TIF|tif|PSD|psd|GIF|gif|doc|DOC|pdf|PDF|mp4|MP4|png|PNG|xls|XLS|xlsx|XLSX|docx|DOCX)$

All version from the nef will be a version from it, the nef is the master.
Easy and works nice.

But now we have some cameras (e.g. a Sony), what produces only jpg (no raws).
Hence we do create a version from it, this means we have a jpg as master and another jpg should be the version of this master.
But both are jpgs.


But in the raw-versioning we have very often jpgs as Version (from the nef).

The orignal jpg would be something like: 20190422-1658-365248-s-pri-kueh_h.jpg
The version would be: 20190422-1658-365248-s-pri-kueh_h_v1.jpg

For such cases I have read about chain-versioning.
But I am not sure.

Does anybody have a clever idea how to handle this situation?



Best wishes from Switzerland! :-)
Markus

Mario

Using the same file extension for both the master and the version can cause problems.
Especially if you have also another file relation where jpg is used as the version. Easy to confuse the version detection.
Especially if you consider situations where you move, copy or rename files, produce new jpg files on another application. Is this jpeg a version? or maybe a master? Or both...?

IMatch can handle this of course - with a bit of care on your part.

You can keep this under control fairly by keeping the versions in dedicated (specifically named) sub-folders.
So you can tell IMatch in which folder exactly to search for versions.
if the jpg masters are in folder "A" (A can be anything, mind), and the jpg versions can only be in "A"\versions, you can easily handle this by searching only in the "versions" sub-folder.
This is the fastest and most secure way, I suppose.
In this case you of course need to avoid to mix master jpeg files and version jpeg files in the same folder (which is never a good idea).

Or, make sure that the versions can be easily detected by their file name (some postfix or prefix that never appears in the master jpeg file name). Then you can make a specific regexp to detect the correct type of jpeg as the master and the correct type of jpeg as the version.

Other ways to handle this would be to limit the rule to files with a specific camera name for the master (via a variable) etc.
This allows you to consider only jpg files taken with a SONY Bla-123 as masters.
This is a bit slower and probably more obfuscated...

Keeping the versions in a separate sub-folder or using a specific naming convention for them is the best way to go.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Quote from: Mario on May 02, 2019, 03:42:54 PM
Or, make sure that the versions can be easily detected by their file name (some postfix or prefix that never appears in the master jpeg file name). Then you can make a specific regexp to detect the correct type of jpeg as the master and the correct type of jpeg as the version.

Mario, thank you very mutch for your very fast answer - and even very deeply explained.

Hm, I think about your proposal above.
My naming - convention, the names are always different.

Say, I would take pics with two cameras from the same event, even at the same time (what is seldom).
I would end nevertheless with a different naming, because my different unique numbers:

20190422-1658-365249-s-pri-kuehe-auf-alp_m.nef (original - Nikon-cam)
20190422-1658-365250-s-pri-kuehe-auf-alp_h.jpg (original - Sony-cam)

Hence the jpg version of both would be:
20190422-1658-365249-s-pri-kuehe-auf-alp_m_v1.jpg
20190422-1658-365250-s-pri-kuehe-auf-alp_h_v1.jpg

If I read your sentences correct, I could take rule with a part of name:
Master-expression: \.(jpg|JPG)$
Link expression: ^{name}:21.*\.(jpg|JPG|TIF|tif|PSD|psd)$

If I do so, the jpg-version from a nef should not be a problem for the jpg-version from the master-version.

If this is correct, I go this way.

Another way, I just have thought, would be to set the jpg-jpg - Relations manually (because jpg as master is not that often).




Best wishes from Switzerland! :-)
Markus

Mario

I cannot say more. See my 3 possible ways to handle this. Try it out on your machine and with your files.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Quote from: Mario on May 02, 2019, 06:14:02 PM
I cannot say more. See my 3 possible ways to handle this. Try it out on your machine and with your files.

Thanks! I will do so.
Best wishes from Switzerland! :-)
Markus

ubacher

I am using chained dependancies:
Nef to jpg: name must be the same.
Jpg to jpg: Version name must be at least one character longer. I use this link expression:
^(_*{name}).{1}.*\.(jpg|jpeg)$

Works OK. No need to use different folders.

lbo

Quote from: ubacher on May 04, 2019, 05:19:19 PM
Jpg to jpg: Version name must be at least one character longer. I use this link expression:
^(_*{name}).{1}.*\.(jpg|jpeg)$

as far as I know, {1} is redundant in PCRE. Therefore, ".{1}" is the same as "."

Like this shorter expression also does the job (can't test it at the moment):
^(_*{name}).+\.(jpg|jpeg)$

sinus

Thanks ubacher and lbo!

I will look into this and test it!
Interesting idea!
Best wishes from Switzerland! :-)
Markus