DNG: Can't modify Exif.SubImage1.*

Added by Thomas Duvrai about 8 years ago


I'm having trouble adding or modifying sub IFD exif data in DNG files using exiv2 version 0.23
I don't get any error message, but the value is never applied:

$ exiv2 -v -M"set Exif.SubImage1.OpcodeList1 0" 000000.dng 
File 1/1: 000000.dng
Set Exif.SubImage1.OpcodeList1 "0" (Undefined)

$ exiv2 -g Exif.SubImage1.OpcodeList1 000000.dng 
OpcodeList1 should have been created, but it is not. It works fine for Exif.Image.*
$ exiv2 -v -M"set Exif.Image.OpcodeList1 0" 000000.dng 
File 1/1: 000000.dng
Set Exif.Image.OpcodeList1 "0" (Undefined)

$ exiv2 -g Exif.Image.OpcodeList1 000000.dng 
Exif.Image.OpcodeList1                       Undefined   1  0
Is this a bug or am I doing something wrong here?
I attached a DNG sample file.

Replies (3)

RE: DNG: Can't modify Exif.SubImage1.* - Added by Andreas Huggel about 8 years ago

Hi Thomas,

What happens is that because SubImage1 contains a primary image, Exiv2 classifies all tags in the IFD as "image tags", i.e., tags which are part of the image rather than the metadata and which can't be modified. ("Image tags" are discussed in issue #668 and in the linked forum post.)

The decision to consider tags in SubImage IFDs containing primary images as "image tags" was introduced to prevent issues with NEFs, simply because we do not understand NEFs well enough to decide which tags can safely be modified in these sub-IFDs.

For DNGs, we may know better, however, both DNGs and NEFs are quite naively treated as TIFF-images when determining whether a tag is an "image tag" or can be modified.

I don't see a quick way for you to work around or fix this limitation, unless you want to modify the code (tiffimage.cpp, remove the if-statement around line 2214 or return false from it)


RE: DNG: Can't modify Exif.SubImage1.* - Added by Thomas Duvrai about 8 years ago

I don't know C++ but changing true to false in that file IS the quick workaround :-)
Thanks a lot Andreas! Any idea if this will become a feature one day?

RE: DNG: Can't modify Exif.SubImage1.* - Added by Robin Mills over 5 years ago


This matter has resurfaced and discussed in #1182. I have not decided what to do about this, however it's now on my radar. I have been thinking about getting a GSoC student to join the team in 2017 to work on #992. GSoC is Google Summer of Code. Google sponsor students to spent their summer vacation working on an approved open-source project. Working on our raw image support seems very well suited to GSoC.