Exiv2标签插入支持

时间:2014-10-23 13:19:54

标签: exiv2 dng

exiv2的功能是否存在限制,阻止其插入标签Exif.SubImage1.OpcodeList3'到DNG文件?

我正在尝试将此标记从一个DNG文件复制到另一个DNG文件但没有成功。

我的源文件是使用以下方式打印的: exiv2.exe -b -pa file.dng> output.txt的

文件output.txt包含: Exif.SubImage1.OpcodeList3未定义184 0 0 0 1 0 0 0 1 1 3 0 0 0 0 0 0 0 0 0 164 0 0 0 3 63 240 0 0 119 176 58 28 191 185 132 79 191 248 95 209 63 154 58 10 83 149 62 10 191 117 109 20 1 60 213 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 63 240 0 0 0 0 0 6 191 185 168 230 29 114 106 51 63 154 226 203 140 13 160 159 191 117 201 88 36 225 127 123 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 63 239 255 253 213 88 87 206 191 185 163 231 88 112 250 50 63 155 248 100 114 115 143 207 191 118 115 180 47 58 216 144 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 63 223 227 192 112 254 60 7 63 224 0 0 0 0 0 0

我试图将此标记添加到不是由(例如)命令文件提供的其他DNG文件中: 添加Exif.SubImage1.OpcodeList3未定义" 0 0 0 1 0 0 0 1 1 3 0 0 0 0 0 0 0 0 0 164 0 0 0 3 63 240 0 0 119 176 58 28 191 185 132 79 191 248 95 209 63 154 58 10 83 149 62 10 191 117 109 20 1 60 213 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 63 240 0 0 0 0 0 6 191 185 168 230 29 114 106 51 63 154 226 203 140 13 160 159 191 117 201 88 36 225 127 123 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 63 239 255 253 213 88 87 206 191 185 163 231 88 112 250 50 63 155 248 100 114 115 143 207 191 118 115 180 47 58 216 144 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 63 223 227 192 112 254 60 7 63 224 0 0 0 0 0 0"

但文件保持不变。

我也尝试过这样的事情:添加Exif.SubImage1.OpcodeList3 Undefined" 0 0 0 1 0"

但是仍然没有添加标签。我怀疑exiv2不支持插入此标记。

我做错了什么还是不支持?

1 个答案:

答案 0 :(得分:0)

问题解决了:答案here(关于OpcodeList1)解释了为什么这样的标签不被exiv2操纵。为了解决这个问题,我通过替换:

更改了tiffimage.cpp
        if (   pPrimaryGroups != 0
            && !pPrimaryGroups->empty()
            && group != ifd0Id) {
#ifdef DEBUG
            ExifKey key(tag, groupName(group));
            std::cerr << "Image tag: " << key << " (2)\n";
#endif
            return true;
        }

使用:

        if (   pPrimaryGroups != 0
            && !pPrimaryGroups->empty()
            && group != ifd0Id) {

            bool opcode3 = tag == 0xc74e;

#ifdef DEBUG
            ExifKey key(tag, groupName(group));
            if (!opcode3)
                std::cerr << "Image tag: " << key << " (2)\n";
            else
                std::cerr << "Not an image tag: " << key << " (2)\n";
#endif
            return !opcode3;
        }