Canon VRD and DR4: How can I copy values from a VRD tag to a DR4 tag?

Started by vanhalen52, August 14, 2018, 10:11:54 PM

Previous topic - Next topic

vanhalen52

The Canon VRD (DPP3) and DR4 (DPP4) blocks have several parameters with identical tag names (i.e. AngleAdj) but obviously different tag
ID numbers.
exiftool -a -D or exiftool -a -H lets me view both AngleAdj tags (with ID numbers)
but when I try to write a new value, using the command
exiftool -AngleAdj=1.23
I can only change the value of the DPP3 block.

How can I access the duplicate parameter and update it? (the goal is to read the tags from the DPP3 block and migrate some/most of the DPP3 adjustments to DPP4)

-Paul

StarGeek

Use the command from FAQ #3 to find out the group each belongs to.  Then prefix the tag with the group name to write to that group.  I don't have a file with these canon tags so I can't be specific but it would be something like
exiftool "-dpp4:AngleAdj<dpp3:AngleAdj"

Change the dpp3/4 in my above example to what the actual group names are. 
...
I was able to find a couple pix with AngleAdj in them, but they only seemed to have one such tag in them.  The group name for them was CanonVRD.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

Hi Paul,

Thanks for pointing out this problem.  I tested this here and ExifTool was giving this error:

Error: [minor] DR4 pointer references previous VRD1 directory

which was preventing it from writing one of the AngleAdj values.  This will be fixed in ExifTool 11.10.

I think this is the same problem you were experiencing.

- 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 ($).

vanhalen52

Phil,

Thanks for the response.
I'll wait for the next version

-Paul

vanhalen52

Phil,

Thanks for the update. DR4 tags can now be written.

I now have another issue: some parameters can be written but
the new values don't show up when I open the picture with DPP4.

As an example:
exiftool -ShadowAdj=5 img.cr2        # Change the raw shadow value
exiftool -a -s2 -ShadowAdj img.cr2  # The new value shows

Import img.cr2 in DPP4 and the shadow value has not been updated.
This same problem occurs with ContrastAdj, ColorToneAdj and HighlightAdj

Am I doing something wrong?

Thanks,
Pauul


Phil Harvey

Hi Paul,

It looks like we have some work to do to figure out why DPP4 isn't recognizing the change.  Likely something else needs changing as well.  Try changing it with DPP4 and using exiftool -a -G1 -u before and after to see what it changed.

- 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 ($).

vanhalen52

Hi Phil,

Good catch!!
Yes, you're right: DPP4 is changing multiple tags.

So executing:
exiftool -ContrastAdj=3 -GammaContrast=3 img.cr2
updates the Contrast setting in DPP4.

Unfortunately there is more: the settings are changed only for the auto/shot settings picture style,
no matter what picture style is active.

The undecoded tags CanonVRD_DR4_0x20302 also changes
and tags CanonVRD_DR4_0x20a01 through CanonVRD_DR4_0x20a20 also change sometimes.
The latter are commented to be picture style settings in the code (i.e. the DPP3 tags LandscapeRawContrast, LandscapeRawShadow ... ?)

-Paul

Phil Harvey

Hi Paul,

Yes.  I remember some complex behaviour like this from when I was working on VRD decoding.  The problem is trying to make sense of this and give the tags meaningful names, which could be a bit of work.

- 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 ($).

vanhalen52

Hi Phil,

On a different (related) note, extracting the binary VRD block doesn't always work.
1. Edit a CR2 picture with DPP3
    'exiftool -b -CanonVRD pic.cr2 > pic.vrd' will produce the VRD block.
2. Edit the same picture with DPP4
    'exiftool -b -CanonDR4 pic.cr2 > pic.dr4' extracts the DR4 info
    'exiftool -b -CanonVRD pic.cr2 > pic.vrd' produces an empty file.

Not sure if this is intentional but the VRD info is present and I can extract it with the attached script.
exiftool has no problem processing this extracted VRD file.

-Paul

Phil Harvey

...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

The problem is that a VRD file contains the Canon header/footer (ie. the entire trailer for a DPP3-edited file), while a DR4 file contains only the DR4 edit record (which is only one of the records inside the trailer).  So when the trailer contains a DR4 record, ExifTool extracts it and disables extraction of the entire trailer because this wouldn't make sense for a DPP4-edited file.  If it extracted the entire trailer as a CanonVRD block it would contain the DPP4 DR4 record, which shouldn't exist in a VRD file.  I suppose that I could construct a fake VRD file from the trailer minus the DR4 record if DPP3 edit information exists, but this would be some work and goes against the general scheme of extracting only fully-formed embedded files as separate tags.

- 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 ($).

vanhalen52

Hi Phil,

I see what you mean.
Unfortunately, Canon, in their infinite wisdom, does mix the DR4 blocks inside the VRD block.
DPP3 and DPP4 edits can, and do, coexist. The problem with the current configuration is that
if I extract the DR4 block from a picture that has both DPP3 and DPP4 edits, modify the DR4
block and then write it back to the picture the DPP3 edits (in the VRD block) get erased.
Not sure if there is a good/clean solution.

Back to the problem of Picture settings in DR4: I did figure out where DPP4 stacks the picture
setting data (see attached file).

If ony I now knew how to read/write this with exiftool. Would that be possible through an appropriate
exiftool_config file? If so, where can I find a pointer on how to go about this?

-Paul

Phil Harvey

Hi Paul,

Quote from: vanhalen52 on August 29, 2018, 07:57:38 PM
The problem with the current configuration is that
if I extract the DR4 block from a picture that has both DPP3 and DPP4 edits, modify the DR4
block and then write it back to the picture the DPP3 edits (in the VRD block) get erased.

Good point.  I should fix this but I will wager that you are the only one who uses ExifTool to do this.

QuoteBack to the problem of Picture settings in DR4: I did figure out where DPP4 stacks the picture
setting data (see attached file).

I'll take a close look at this when I get a chance.

QuoteIf ony I now knew how to read/write this with exiftool. Would that be possible through an appropriate
exiftool_config file? If so, where can I find a pointer on how to go about this?

Take a look at the Image::ExifTool::CanonVRD::DR4 tag table definitions in the CanonVRD.pm file.  You can add user-defined definitions using this format in a config file.  See the sample config file for the basic syntax of the config file.

- 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 ($).