ianare / exif-py

Easy to use Python module to extract Exif metadata from digital image files.
BSD 3-Clause "New" or "Revised" License
832 stars 191 forks source link

BlackLevel and WhiteLevel tags are not found for some images #130

Open amonod opened 3 years ago

amonod commented 3 years ago

As stated in the title, for some images exifread.process(f) does not extract the BlackLevel / 0x61a or the WhiteLevel / 0x61d tags. G0030931.zip

Attached is a ZIP with a raw DNG file where it is the case. These tags are certainly existent in image metadata, because they are found using exiftool (version 11.92 in my case):

0xc61a Black Level : 0 0 0 0 0xc61d White Level : 16383

kmilos commented 3 years ago

Some (notably most recent smartphone) DNGs only have the single IFD0 (perfectly valid), while these tags might currently be searched for only in the "Exif" (or other?) IFDs...

You can get more info on the file structure using e.g. exiftool -a -u -s -G1.

Btw, TIFF/EP (and DNG) specs have no formal relation to (apart from some intentional tag overlap with a few exceptions) and do not guarantee the presence of an Exif IFD.

Edit: Sorry for the rambling (still useful info I hope); this file came from Adobe DNG converter and it does have an Exif IFD, but those tags are not located there nor in the main IFD0 as I mentioned, but rather in the full-resolution image sub-IFD...