Skip to content

Commit c32a919

Browse files
committed
FIX: ISOSPEEDRATINGS is of type SHORT, larger ISO values stored in RECOMMENDED_EXPOSURE_INDEX
1 parent 82ee942 commit c32a919

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/librawspeed/decoders/Cr3Decoder.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,14 @@ void Cr3Decoder::decodeMetaDataInternal(const CameraMetaData* meta) {
563563
iso = canonBox->CMT2()
564564
->mRootIFD0->getEntryRecursive(ISOSPEEDRATINGS)
565565
->getU32();
566+
if(65535 == iso) {
567+
// ISOSPEEDRATINGS is a SHORT EXIF value. For larger values, we have to look
568+
// at RECOMMENDED_EXPOSURE_INDEX (maybe Canon specific).
569+
if (canonBox->CMT2()->mRootIFD0->hasEntryRecursive(RECOMMENDED_EXPOSURE_INDEX))
570+
iso = canonBox->CMT2()
571+
->mRootIFD0->getEntryRecursive(RECOMMENDED_EXPOSURE_INDEX)
572+
->getU32();
573+
}
566574

567575
// Big raw image is always in track 4
568576
assert(rootBox->moov()->tracks.size() >= 4);

src/librawspeed/tiff/TiffTag.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ enum TiffTag {
158158
GPSINFOIFDPOINTER = 0x8825,
159159
ISOSPEEDRATINGS = 0x8827,
160160
OECF = 0x8828,
161+
RECOMMENDED_EXPOSURE_INDEX = 0x8832,
161162
EXIFVERSION = 0x9000,
162163
DATETIMEORIGINAL = 0x9003,
163164
DATETIMEDIGITIZED = 0x9004,

0 commit comments

Comments
 (0)