photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: Stefanjan on July 21, 2021, 01:31:43 PM

Title: Phone DNG / JPEG versioning
Post by: Stefanjan on July 21, 2021, 01:31:43 PM
I have the following version definition:

\.(dng)$
/^_*//
^(_*{name})[+\-_]*[0-9|a-z]*\.(jpg|jpeg|tif|tiff)$

My phone created the following files:

IMG_20210721_121619.dng
IMG_20210721_121619_1.jpg

IMG_20210721_121621.dng
IMG_20210721_121621_1.jpg

IMG_20210721_121623.dng
IMG_20210721_121623_1.jpg

IMG_20210721_121625_1.dng
IMG_20210721_121625_2.jpg

The first three sets stack ok.

The last set is not recognised as a version set.

I have no idea why my phone adds _1.dng to some of the files and not others.  Would appreciate thoughts as to how I can edit the definition to pick up the last set.
Title: Re: Phone DNG / JPEG versioning
Post by: thrinn on July 21, 2021, 01:54:34 PM
The regular expressions (RegExp) in the version rule definition basically say: For a given DNG file, take all JPGs as versions if they start with the same name, optionally followed by +, -, or _, followed by numbers and/or letters.

The problem with your 4th set of files is that the "base name" differs because the "_1" is part of the DNG name, but not of the JPG name. There is no easy solution for this. It would be possible to restrict the check to the first 19 characters of the file name (DNG and JPG must have the first 19 characters of the file name in common) but I suspect this would not work for all cases: What happens if you take more than one photo in the same second? For example, in burst mode? How are the files numbered then? Would you get different DNGs, all starting with the same timestamp? Then the rule would not work correctly.
Title: Re: Phone DNG / JPEG versioning
Post by: Tveloso on July 21, 2021, 02:33:27 PM
Could the replacement expression be used to strip the occasionally present "_1" from the DNG FileName?...something like:

    /_[0-9]\./\./

The existing replacement expression is not actually doing any work with the given FileNames (since they don't start with an underscore), so it could possibly be replaced with one that's meant to strip he unwanted FileName suffix...but this would of course break the version definition for other (non Phone) DNG files if it's used for those as well.

It may be possible to have two replacement expressions (in order to preserve the existing one), but I'm not sure of the syntax...if it would be:

    /replaceThis/withThat/replaceThis/withThat/

...or:

    /replaceThis/withThat//replaceThis/withThat/

Or, the syntax aside, if IMatch will support that...
Title: Re: Phone DNG / JPEG versioning
Post by: Stefanjan on July 21, 2021, 03:01:16 PM
Quote from: thrinn on July 21, 2021, 01:54:34 PM
It would be possible to restrict the check to the first 19 characters of the file name (DNG and JPG must have the first 19 characters of the file name in common)
I tried changing the link expression to ^{name}:19.*\.jpg$ but this still did not pick up the last set.

Quote
What happens if you take more than one photo in the same second?
It's impossible to take more than 1 frame per second due to time taken to write the raw and jpeg to disk.
Title: Re: Phone DNG / JPEG versioning
Post by: Stefanjan on July 21, 2021, 03:03:34 PM
Quote from: Tveloso on July 21, 2021, 02:33:27 PM
but this would of course break the version definition for other (non Phone) DNG files if it's used for those as well.
My cameras only take Canon or Panasonic Raw so not likely to be an issue.
Title: Re: Phone DNG / JPEG versioning
Post by: Stefanjan on July 21, 2021, 03:05:50 PM
I've noticed that most of the time F4, R does not work to refresh relations. The R puts a red pin on the images. I have to refresh relations via Commands menu!
Title: Re: Phone DNG / JPEG versioning
Post by: Mario on July 21, 2021, 03:47:26 PM
You must press the second part of the hotkey within one second.
Else IMatch will consider the <R> alone.

See How to Use Keyboard Shortcuts (https://www.photools.com/help/imatch/#cheat_sheets.htm?dl=h-2)
Title: Re: Phone DNG / JPEG versioning
Post by: Stefanjan on July 21, 2021, 04:14:55 PM
Quote from: Mario on July 21, 2021, 03:47:26 PM
You must press the second part of the hotkey within one second.
OK thanks
Title: Re: Phone DNG / JPEG versioning
Post by: Rene Toepfer on July 23, 2021, 09:52:02 AM
Quote from: Stefanjan on July 21, 2021, 03:01:16 PM
I tried changing the link expression to ^{name}:19.*\.jpg$ but this still did not pick up the last set.

I use this expression for a specific length of the filename: \.(arw|cr2|crw)$
/^_*//
^{name}:29.*\.(jpg|jpeg|tif|tiff|psd|afphoto|afdesign|afpub)$



If you changed the relation you have to rescan.
Title: Re: Phone DNG / JPEG versioning
Post by: Stefanjan on July 24, 2021, 07:08:37 PM
Quote from: Rene Toepfer on July 23, 2021, 09:52:02 AM
Many thanks Rene, that helped me out enormously.

Just one small point, I have "Use this version" checked against "As Visual" and all the other options.

The JPEG version displays correctly when I view the DNG file in the browser, in the viewer icons along the bottom but not in the Viewer itself. The viewer displays the raw DNG file. Is this by design?
Title: Re: Phone DNG / JPEG versioning
Post by: Mario on July 24, 2021, 07:52:28 PM
You can toggle what the Viewer shows. Visual Proxy (https://www.photools.com/help/imatch/#viewer.htm?dl=h-22)
Title: Re: Phone DNG / JPEG versioning
Post by: Stefanjan on July 24, 2021, 11:19:16 PM
Quote from: Mario on July 24, 2021, 07:52:28 PM
You can toggle what the Viewer shows. Visual Proxy (https://www.photools.com/help/imatch/#viewer.htm?dl=h-22)
Perfect