Skip to content

Commit a30f9c5

Browse files
committed
FIX: ISOSPEEDRATINGS is of type SHORT, larger ISO values stored in RECOMMENDEDEXPOSUREINDEX
1 parent c44048d commit a30f9c5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-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(RECOMMENDEDEXPOSUREINDEX))
570+
iso = canonBox->CMT2()
571+
->mRootIFD0->getEntryRecursive(RECOMMENDEDEXPOSUREINDEX)
572+
->getU32();
573+
}
566574

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

0 commit comments

Comments
 (0)