Write to unknown tags in Sony MakerNote and SR2SubIFD

Started by Gerein, May 12, 2015, 02:15:25 PM

Previous topic - Next topic

Gerein

Hi,

I'm trying to decode the embedded lens-profiles in Sony's ARW (v2.3.1). I (think I) have narrowed down the potentially relevant tags but am struggling to write to them using Exiftool.

This is what I'm trying to do:


$ exiftool -u -G1 -Sony_0x201f photo.ARW
[Sony]          Sony 0x201f                     : 128 17 2 0

$ exiftool -u -G1 -Sony_SR2SubIFD_0x797d photo.ARW
[SR2SubIFD]     Sony SR2 Sub IFD 0x797d         : 16 0 64 128 288 640 1344 2272 3328 4448 5568 6720 7840 [...]

$ cat exif_config
%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Exif::Main' => {
        0x201f => {
            Name => 'Sony_tag',
            Writable => 'int8u',
            WriteGroup => 'Sony',
            Count => 4,
            Protected => 1,
        },
        0x797d => {
            Name => 'SR2_tag',
            Writable => 'int16s',
            WriteGroup => 'SR2SubIFD',
            Count => 17,
            Protected => 1,
        },
    },
);

$ exiftool -config exif_config -u -Sony_tag="50 50 50 50" photo.ARW
    0 image files updated
    1 image files unchanged

$ exiftool -config exif_config -u -SR2_tag="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17" photo.ARW
    0 image files updated
    1 image files unchanged


Exiftool seems to take the command but doesn't write to the file. SR2SubIFD is tagged non-writable (I think there's encryption) but the Sony Makernote should be writable...?

Am I doing something wrong? If the problem is that the tags are non-writable, could you give me a hint on where to start if I wanted to hack that into Exiftool (if realistic)? Is there a simpler (not for production) short-cut to adapt these tags? I just want to test the reaction of Adobe's DNG-converter to changed tags.

Thanks!

Phil Harvey

You were good at providing most of the information I needed.  (The only thing missing was the camera model, but I found one that should be OK.)

Try this config file:

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Sony::Main' => {
        0x201f => {
            Name => 'Sony_tag',
            Writable => 'int8u',
            WriteGroup => 'MakerNotes',
            Count => 4,
            Protected => 1,
        },
    },
    'Image::ExifTool::Sony::SR2SubIFD' => {
        0x797d => {
            Name => 'SR2_tag',
            Writable => 'int16s',
            WriteGroup => 'SR2SubIFD',
            Count => 17,
            Protected => 1,
        },
    },
);


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

Gerein

Works! Thanks a lot!

Will report back should I succeed in figuring out where Sony hides the embedded lens-profile (distortion correction / CA correction).

(Camera is a Sony A7/ILCE-7 btw.)