ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: horshack on February 08, 2024, 12:27:43 PM

Title: Unable to remove OpCodeList2 opcodes from DNG
Post by: horshack on February 08, 2024, 12:27:43 PM
I have a Sony A7rIV raw converted to DNG that I'm attempting to remove the lens correction profiles from. I'm able to remove the OpcodeList3 entries but not OpcodeList2 - exiftool seems to ignore the request. It reports the OpcodeList2 entries even after attempting deletion.

Command line:
exiftool -OpCodeList2= -OpCodeList3= -overwrite_original Sony_A7rIV_20mm.dng

I tried a few older DNG conversions/versions of the same file and see the same behavior.

Here's a link to a DNG that this can be reproduced with: Sony_A7rIV_20mm.dng (Google Drive) (https://drive.google.com/file/d/1LrYVkZQ8Izhb0OZbYTpR-59uoNoTTnDx/view?usp=sharing)
Title: Re: Unable to remove OpCodeList2 opcodes from DNG
Post by: StarGeek on February 08, 2024, 01:17:20 PM
If you look at the file with the command in FAQ #3 (https://exiftool.org/faq.html#Q3) (limiting it to just OpcodeList* tags), you will see that there are multiple OpcodeList2, but they are in locations other than SubIFD
C:\>exiftool -G1 -a -s -op* Y:\!temp\x\y\z\Sony_A7rIV_20mm.dng
[SubIFD]        OpcodeList3                     : WarpRectilinear
[SubIFD2]       OpcodeList2                     : MapPolynomial, MapPolynomial, MapPolynomial
[SubIFD3]       OpcodeList2                     : MapPolynomial, MapPolynomial, MapPolynomial
[SubIFD4]       OpcodeList2                     : MapPolynomial, MapPolynomial, MapPolynomial

By default, exiftool will not remove the tag from locations other than the main SubIFD.  To remove these, you need to include the exact group
C:\>exiftool -P -overwrite_original -SubIFD2:OpcodeList2= Y:\!temp\x\y\z\Sony_A7rIV_20mm.dng
    1 image files updated

C:\>exiftool -G1 -a -s -op* Y:\!temp\x\y\z\Sony_A7rIV_20mm.dng
[SubIFD]        OpcodeList3                     : WarpRectilinear
[SubIFD3]       OpcodeList2                     : MapPolynomial, MapPolynomial, MapPolynomial
[SubIFD4]       OpcodeList2                     : MapPolynomial, MapPolynomial, MapPolynomial

C:\>exiftool -P -overwrite_original -SubIFD3:OpcodeList2= -SubIFD4:OpcodeList2= Y:\!temp\x\y\z\Sony_A7rIV_20mm.dng
    1 image files updated

C:\>exiftool -G1 -a -s -op* Y:\!temp\x\y\z\Sony_A7rIV_20mm.dng
[SubIFD]        OpcodeList3                     : WarpRectilinear
Title: Re: Unable to remove OpCodeList2 opcodes from DNG
Post by: horshack on February 08, 2024, 05:25:11 PM
Thanks @StarGeek!