@@ -189,21 +189,7 @@ void RafDecoder::checkSupportInternal(const CameraMetaData* meta) {
189189 }
190190}
191191
192- void RafDecoder::decodeMetaDataInternal (const CameraMetaData* meta) {
193- int iso = 0 ;
194- if (mRootIFD ->hasEntryRecursive (TiffTag::ISOSPEEDRATINGS))
195- iso = mRootIFD ->getEntryRecursive (TiffTag::ISOSPEEDRATINGS)->getU32 ();
196- mRaw ->metadata .isoSpeed = iso;
197-
198- // This is where we'd normally call setMetaData but since we may still need
199- // to rotate the image for SuperCCD cameras we do everything ourselves
200- auto id = mRootIFD ->getID ();
201- const Camera* cam = meta->getCamera (id.make , id.model , mRaw ->metadata .mode );
202- if (!cam)
203- ThrowRDE (" Couldn't find camera" );
204-
205- assert (cam != nullptr );
206-
192+ void RafDecoder::applyCorrections (const Camera* cam) {
207193 iPoint2D new_size (mRaw ->dim );
208194 iPoint2D crop_offset (0 , 0 );
209195
@@ -267,6 +253,24 @@ void RafDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
267253 } else if (applyCrop) {
268254 mRaw ->subFrame (iRectangle2D (crop_offset, new_size));
269255 }
256+ }
257+
258+ void RafDecoder::decodeMetaDataInternal (const CameraMetaData* meta) {
259+ int iso = 0 ;
260+ if (mRootIFD ->hasEntryRecursive (TiffTag::ISOSPEEDRATINGS))
261+ iso = mRootIFD ->getEntryRecursive (TiffTag::ISOSPEEDRATINGS)->getU32 ();
262+ mRaw ->metadata .isoSpeed = iso;
263+
264+ // This is where we'd normally call setMetaData but since we may still need
265+ // to rotate the image for SuperCCD cameras we do everything ourselves
266+ auto id = mRootIFD ->getID ();
267+ const Camera* cam = meta->getCamera (id.make , id.model , mRaw ->metadata .mode );
268+ if (!cam)
269+ ThrowRDE (" Couldn't find camera" );
270+
271+ assert (cam != nullptr );
272+
273+ applyCorrections (cam);
270274
271275 const CameraSensorInfo *sensor = cam->getSensorInfo (iso);
272276 mRaw ->blackLevel = sensor->mBlackLevel ;
0 commit comments