How to write Canon tags to DNG

Started by teran, December 31, 2019, 07:44:14 PM

Previous topic - Next topic

teran

Hello,

I'm developing the tool helping to handle metadata in film scans and trying to write some Canon tags to DNG like this way:

exiftool -overwrite_original "-CanonCustom:PF2DisableMeteringModes=Off" "-ExifIFD:MeteringMode=Multi-Segment" "-Canon:MeteringMode=Evaluative" file.dng

And can't get them written (except `ExifIFD:MeteringMode` which is written successfully, checking by `exiftool -X`).

At the same time I see it's technically possible to use Canon proprietary tags in DNG: if I try to convert any Canon RAW file to DNG - all the metadata tags will be at the right place.

What am I doing wrong?

Thanks in advance.

StarGeek

See FAQ #23.

    Also note that MakerNotes tags can not be created or deleted individually, so they can only be written if they already exist in a file. The entire MakerNotes must be created or deleted as a block (see FAQ number 8 for details).
"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

teran

Quote from: StarGeek on December 31, 2019, 11:13:06 PM
See FAQ #23.

    Also note that MakerNotes tags can not be created or deleted individually, so they can only be written if they already exist in a file. The entire MakerNotes must be created or deleted as a block (see FAQ number 8 for details).

Thanks a lot, that helped!

But I got a bit more questions:)

- Now I tried to export metadata to JSON with `-json` but this format looks not complete, i.e. it doesn't contain Canon:* and CanonCustom:* fields, am I right guessing it's not suitable to transfer proprietary data?
- Is there a way to make exiftool to treat proprietary fields like Canon:*, CanonCustom:* passed via commandline as a complete section of data to write?
- Is there a way to pass some XML/JSON/any other structured data exiftool's STDIN as metadata source instead of command line args or files?

Thanks a lot!

Phil Harvey

Can you upload a DNG sample somewhere so can take a look?  The Canon metadata may be stored in different locations depending on how it was produced.  ExifTool can not write Canon maker notes if they are written in the proprietary Adobe maker note format (ie. if they were added before the file was converted to DNG by an Adobe utility).

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

teran

Quote from: Phil Harvey on January 01, 2020, 08:22:13 AM
Can you upload a DNG sample somewhere so can take a look?  The Canon metadata may be stored in different locations depending on how it was produced.  ExifTool can not write Canon maker notes if they are written in the proprietary Adobe maker note format (ie. if they were added before the file was converted to DNG by an Adobe utility).

- Phil

If that's about converted on from CR2 file, here it is: https://disk.yandex.com/i/C9dGIC2b4nufzA
Obtained right from Adobe bridge via Convert to DNG (default settings).

QuoteExifTool can not write Canon maker notes if they are written in the proprietary Adobe maker note format
Oh, so you suppose it could be just Adobe's representation of native Canon metadata?

Is there a way to preserve it somehow?
The real case is: I have some fields, like `MeteringMode`(or `ShootingMode`) obtained from Canon really old software for film camera (Canon ES-E1) which couldn't be directly translated to EXIF value, so it looks the most reasonable to store it in native way in Canon:* fields.

Thanks!

Phil Harvey

In fact, ExifTool does write these maker notes because they haven't been mangled too badly by Adobe (this is different for different makes).  However, it can't be used to create an Adobe makernote block, so these tags may only be written individually.  If you write the maker notes to a DNG using ExifTool, it will create it in the standard location, so in this case the file would then contain two makernote blocks:

exiftool -json -b -makernotes SRC.dng > out.json

then

exiftool -tagsfromfile out.json -makernotes DST.dng

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

teran

Quote from: Phil Harvey on January 01, 2020, 08:48:22 AM
In fact, ExifTool does write these maker notes because they haven't been mangled too badly by Adobe (this is different for different makes).  However, it can't be used to create an Adobe makernote block, so these tags may only be written individually.  If you write the maker notes to a DNG using ExifTool, it will create it in the standard location, so in this case the file would then contain two makernote blocks:

exiftool -json -b -makernotes SRC.dng > out.json

then

exiftool -tagsfromfile out.json -makernotes DST.dng

- Phil

Thank you for the information, it really helped and gave me some ideas how to deal with it!