SonyISO Values in makernotes

Started by lynn, October 26, 2020, 07:12:54 PM

Previous topic - Next topic

lynn

Hi, Phil

I have an image that was shot by Sony ILCA-99M2 with Exif ISO set to 65535. I would like to get the real ISO value from its makernotes
According to https://exiftool.org/TagNames/Sony.html, the SonyISO and BaseISO are stored at tag 0x9405B. The value of the tag of the image is shown below.

0x00000000289C8E70  76 09 7b 6d 00 d8 00 70 00 00 00 d8

SonyISO at Index 4 has value of 0x00d8 or Oxd800  ==>displayed as 102400 in ExifTool.
BaseISO at Index 6 has value of 0x0070 or Ox7000  ==>displayed as 100 in ExifTool.

How do I convert those values to their proper ISO values shown in ExifTool?

Many Thanks,

Lynn

Phil Harvey

Hi Lynn,

The ISO to use should exist as one of the tags reported by ExifTool.  What does this give?:

exiftool "-*iso*" -a -G1 FILE

My guess is that SonyISO is correct, but there should also be a standard EXIF tag with this value.

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

lynn

Hi, Phil,

Thanks for your reply.

I ran the command you suggested and here is the result

[ExifIFD]       ISO                             : 65535
[Sony]          High ISO Noise Reduction        : Off
[Sony]          ISO Setting                     : 102400
[Sony]          ISO Auto Min                    : 100
[Sony]          ISO Auto Max                    : 6400
[Sony]          Sony ISO                        : 102400
[Sony]          Base ISO                        : 100
[Sony]          Stops Above Base ISO            : 10.0
[Sony]          High ISO Noise Reduction        : Normal
[Sony]          Stops Above Base ISO            : 10.0
[Sony]          Sony ISO                        : 102400

As you can see, the ISO value in ExifIFD is 65535. According to the exif standard, the ISOSetting has a type of UINT16 and 65535 is the max value it can display.  For ISO value higher than 65535, we have to rely on its makernotes to get the correct value.  Similar situation for Canon,  I have found the conversion algorithm for Canon in the following thread
https://exiftool.org/forum/index.php?topic=2891.msg12853#msg12853.
It worked so well for converting Canon high ISO values. Thanks for sharing your knowledge with us. 
I am wondering how SonyISO in makernotes is converted.

Thanks,

Lynn



ninpou_bunshinnojutsu

Sony A99 II
Basic Specifications
Native ISO:   100 - 25,600
Extended ISO:   50 - 102,400
?

Phil Harvey

Hi Lynn,

Quote from: lynn on October 27, 2020, 01:19:06 AM
I am wondering how SonyISO in makernotes is converted.

SonyISO = 100 * 2**(16 - RawValue/256)

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

lynn

Hello, Phil,

Thank you so much for the code.

However, if I use your above conversion formula

SonyISO = 100 * 2**(16 - $RawValue/256)  by setting the $RawValue to 0xd800 or 0x00d8.
I won't be able to get the SonyISO value of 102400 at all.

Is there anything I have missed?

Lynn




Phil Harvey

I suggest you use the exiftool -v3 option to view the raw value in hex.

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

lynn

4) Tag9405b (SubDirectory) -->
  | | |     - Tag 0x9405 (2048 bytes, undef[2048]):
  | | |         26e8: 76 09 7b 6d 00 d8 00 70 00 00 00 d8 00 00 d2 81 [v.{m...p........]
  | | |         26f8: 01 00 e1 01 00 be 00 88 00 00 00 00 00 00 00 00 [................]
  | | |         2708: 00 00 00 00 00 00 00 00 00 00 00 00 53 00 00 00 [............S...]
  | | |         2718: 1b 00 00 00 00 00 00 00 e7 d4 e7 00 00 cf 95 a0 [................]
  | | |         2728: 80 20 08 00 01 00 00 00 01 00 00 00 00 00 00 00 [. ..............]
  | | |         [snip 1968 bytes]
  | | | + [Deciphered Tag9405b directory]
  | | | |       26e8: 91 cc 6f 7f 00 06 00 10 00 00 00 06 00 00 99 18 [..o.............]
  | | | |       26f8: 01 00 90 01 00 16 00 13 00 00 00 00 00 00 00 00 [................]
  | | | |       2708: 00 00 00 00 00 00 00 00 00 00 00 00 53 00 00 00 [............S...]
  | | | |       2718: 03 00 00 00 00 00 00 00 09 6b 09 00 00 4e 20 1f [.........k...N .]
  | | | |       2728: c8 14 02 00 01 00 00 00 01 00 00 00 00 00 00 00 [................]
  | | | |       [snip 1968 bytes]
  | | | + [BinaryData directory, 2048 bytes]
  | | | | SonyISO = 1536
  | | | | - Tag 0x0004 (2 bytes, int16u[1]):
  | | | |     26ec: 00 06                                           [..]
  | | | | BaseISO = 4096
  | | | | - Tag 0x0006 (2 bytes, int16u[1]):
  | | | |     26ee: 00 10                                           [..]
It looks like that the data block for tag 0x9405 is encrypted.  The raw hex value for SonyISO (Index 0x0004) in the file is 0xd800 for my ILCA-99M2 image. After the data block is decrypted, the value shows 0x0b00. If I use the raw value of 0x0b00, I will be able to get the SonyISO value of 102400 by using your conversion formula.  Wow, this is so sophisticated!!   How can I decrypt the data block of 0x9405 to become 0x9405B?

Thanks,

Lynn

StarGeek

Quote from: lynn on October 27, 2020, 11:09:34 PMHow can I decrypt the data block of 0x9405 to become 0x9405B?

I could be wrong, but you might take a look at the ProcessEnciphered subroutine in the source code.  Line 10708 if the link doesn't take you to the right spot.
"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

Phil Harvey

I think you probably just want the Decipher code that is called from ProcessEnciphered.

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

JosR

But the standard EXIF tags include 0x8832 Recommended Exposure Index, e.g for ISO 102400:
[ExifIFD]       0x8827 ISO                             : 65535
[ExifIFD]       0x8830 Sensitivity Type                : Recommended Exposure Index
[ExifIFD]       0x8832 Recommended Exposure Index      : 102400
So there is no need to go into the makernotes.

Phil Harvey

@Jos: Good point.  My "-*iso*" would miss that one. :(

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

lynn

@Jos. I have been looking at "Exif/Recommended Exposure Index" before. For Canon and Nikon high ISO images, it doesn't always give the ISO values. However, I have just tried it with all my Sony samples. It worked for all of them. I almost forgot about this tag. I am going to test it with more Sony samples. Thanks for pointing that out. 

@Phil. Thank you for providing me the "Decipher code" as well as answering all my questions. I may need to sharpen my Perl skill and convert it into C++.  We have been using the Exiftool for validating image metadata for years. It is a great tool and amazing is always up-to-date.   Your work is highly appreciated!   

Thanks.

Lynn