Increment/Decrement tag values in CanonVRD

Started by BogdanH, July 05, 2011, 12:31:41 PM

Previous topic - Next topic

BogdanH

Hi Phil,

In short: Canon DPP doesn't have option for selective "recipe" applying. So, it happens, that one applies all necessary settings (brightness, WB, NR, etc.) for each file in set and at the end, it discovers, that (for example) only color saturation on all images needed to be increased (relative to actual value) by one step -this is impossible to accomplish in DPP.
So, it would be usefull to have something like:
exiftool -canonVRD:RawBrightnessAdj+=0.3

Of course, I have no idea how much work would be involved to implement that.

Bogdan

Phil Harvey

Hi Bogdan,

I have just worked up a local version of exiftool that allows any numerical value to be shifted.  It seems to work, but I am concerned that this feature may cause problems because it is so powerful and could easily give unexpected results, for instance if a person thought they were adding an item to a list.

I will have to think about this feature.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

Some examples of how this could work:

> exiftool -artist=me a.jpg
    1 image files updated

> exiftool -artist+=1.1 a.jpg
Warning: Can't shift Artist (not a number) - a.jpg
    0 image files updated
    1 image files unchanged

> exiftool -artist=100 a.jpg
    1 image files updated

> exiftool -artist+=1.1 a.jpg
    1 image files updated

> exiftool -artist a.jpg
Artist                          : 101.1

> exiftool -artist+=that a.jpg
Warning: Shift value is not a number
Nothing to do.


Another example with a tag that has a conversion lookup:

> exiftool a.jpg -whitebalance -whitebalance#
White Balance                   : Manual
White Balance                   : 1

> exiftool a.jpg -whitebalance+=1.1
Warning: Error writing ExifIFD:WhiteBalance - a.jpg
    0 image files updated
    1 image files unchanged

> exiftool a.jpg -whitebalance+=1
    1 image files updated

> exiftool a.jpg -whitebalance -whitebalance#
White Balance                   : Unknown (2)
White Balance                   : 2


- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

BogdanH

Hi,
When asking, I had strict numerical tags in mind -which should simplify the whole thing, hopefully. Of course, right now, I'm seeing only integers inside exif, but there are numbers elsewhere as well (i.e. -Xmp:Rating). So, inc/dec option should be only executed if numerical value allready exist in tag -or if tag is empty.. or not defined yet?
You will figure something out -just keep it simple  :)

Bogdan

Phil Harvey

Hi Bogdan,

I was thinking that nothing would be done if the tag was empty.  I don't think it is reasonable to assume a value of 0 if it is missing.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

Darn.  I had a feeling there was a problem, and I just realized this:

I already use the -= operator for conditional deletion of a value.  I suppose I could still implement +=, but this would result in an ugly asymmetry.  Hmmm, more to think about...

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

BogdanH

Quote from: Phil Harvey on July 06, 2011, 09:03:52 AM
I was thinking that nothing would be done if the tag was empty.  I don't think it is reasonable to assume a value of 0 if it is missing.

You're right -one could get unexpected results.

QuoteI already use the -= operator for conditional deletion of a value.  I suppose I could still implement +=, but this would result in an ugly asymmetry...

You're running out of symbol chars?  :) Yes, there are only few of them easy enough accessible on keyboard, that would symbolize increasing/decreasing...

Bogdan

Phil Harvey

OK, I can get this to work, but I see another FAQ entry coming along if people start to use this...

To increment a value:

-canonVRD:RawBrightnessAdj+=0.3

To decrement a value:

-canonVRD:RawBrightnessAdj+=-0.3

NOT

-canonVRD:RawBrightnessAdj-=0.3 <-- WRONG

(because -= is used for conditional deletion to be backward compatible).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

BogdanH

Well, if you ask me, I would accept that. Maybe, if "+" sign would be required before actual value, then it would look more straight-forward:
-canonVRD:RawBrightnessAdj+=+0.3
and
-canonVRD:RawBrightnessAdj+=-0.3
...meaining something like:
+nn -increment
-nn -decrement

However, I'm aware I tend to complicate things  :)

Bogdan

Phil Harvey

Hi Bogdan,

I don't want to require the 2nd plus sign, but you can certainly use it if you want. :)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

Hi Bogdan,

I don't know if you noticed, but ExifTool 8.61 has this new feature (using "+=" to increment/decrement any numerical tag value).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

BogdanH

Hi Phil,
Of course I've noticed this new option -how couldn't I  :) . Actually I allready started with work to use that in GUI, when I noticed, one can't simply change/shift any value in CanonVRD. So, for example, it isn't enough to change CanonVRD:WhiteBalanceAdj value -at the same time, WBAdjRGGBLevels value also need to be changed properly. And I can imagine, that Canon might change such "hidden" default values anytime in DPP version to come. That is, I don't like the idea to check all these values everytime new DPP version arise
Because of above reason, I'll try to be modest with CanonVRD tags.. by implementing only few "general" settings, like: BrightnessAdj, SaturationAdj, Sharpness..

Bogdan