Prevent crash when opening Canon RP files with different crop factor. Fixes #6255

This commit is contained in:
Thanatomanic 2021-05-24 08:00:09 +02:00
parent 2f2720b763
commit 6189a0e816
2 changed files with 37 additions and 2 deletions

View File

@ -531,10 +531,10 @@ Camera constants:
}
},
{ // Quality B, some missing scaling factors are safely guessed; assuming the RP is the same as the 6DII because they share sensors
{ // Quality B, some missing scaling factors are safely guessed
"make_model": [ "Canon EOS 6D Mark II", "Canon EOS RP" ],
"dcraw_matrix": [ 6875,-970,-932,-4691,12459,2501,-874,1953,5809 ], // DNG v_9.12 D65
"raw_crop": [ 120, 44, 6264, 4180 ], // fullraw size 6384x4224 useful 120,44,6264x4180
"raw_crop": [ 120, 44, 6264, 4180 ], // fullraw size 6384x4224 useful 120,44,6264x4180 // TODO: See EOS RP
// "raw_crop": [ 128, 52, 6248, 4168 ], // official jpeg crop 120+12,44+12,6240x4160
"masked_areas": [ 44, 4, 4220, 116 ],
"ranges": {
@ -566,6 +566,40 @@ Camera constants:
}
},
{ // Quality B, taken from 6D Mark II because identical sensor (different matrix)
"make_model": "Canon EOS RP",
"dcraw_matrix": [ 8608,-2097,-1178,-5425,13265,2383,-1149,2238,5680 ], // DNG v13.2
// Let dcraw handle crop, because camconst shouldn't override for diferent crop factors. See #6255
"masked_areas": [ 44, 4, 4220, 116 ], // Potential problem for different crop factor as well
"ranges": {
"white": [
{ "iso": [ 50, 100, 125, 200, 250, 400, 500, 800, 1000, 1600, 2000, 3200 ], "levels": 16300 }, // typical 16383
{ "iso": [ 4000, 6400, 8000, 12800 ], "levels": 16200 }, // typical 16383
{ "iso": [ 16000, 25600 ], "levels": 16100 }, // typical 16383
{ "iso": [ 160 ], "levels": 13000 }, // typical 13044
{ "iso": [ 320, 640, 1250, 2500 ], "levels": 13250 }, // typical 13337
{ "iso": [ 5000, 10000 ], "levels": 13100 }, // typical 13367
{ "iso": [ 20000, 40000 ], "levels": 12900 }, // typical 13367
{ "iso": [ 51200, 102400 ], "levels": 15900 } // typical 16383
],
"white_max": 16383,
"aperture_scaling": [
// no scale factors known for f/1.0 (had no lenses to test with), but the
// ISO 160-320... 13044 white levels maxes out at "white_max" for f/1.2 and below anyway.
{ "aperture": 1.2, "scale_factor": 1.130 }, // guessed
{ "aperture": 1.4, "scale_factor": 1.100 }, // guessed
{ "aperture": 1.6, "scale_factor": 1.080 }, // guessed
{ "aperture": 1.8, "scale_factor": 1.060 }, // 13890/13044=1.065 11284/10512 = 1.073
{ "aperture": 2.0, "scale_factor": 1.040 }, // 13602/13044=1.042 11151/10512 = 1.060
{ "aperture": 2.2, "scale_factor": 1.030 }, // 10982/10512=1.045
{ "aperture": 2.5, "scale_factor": 1.020 }, // 10840/10512 = 1.030
{ "aperture": 2.8, "scale_factor": 1.010 }, // 13530/13367= 1.012 - 12225/12048 = 1.015
{ "aperture": 3.2, "scale_factor": 1.005 }, // 12194/12048 = 1.012
{ "aperture": 3.5, "scale_factor": 1.000 } // 12092/12048 = 1.004
]
}
},
{ // Quality A, ISO and aperture WL data by CharlyW at RawTherapee forums, missing samples safely guessed
"make_model": "Canon EOS 7D",
"dcraw_matrix": [ 5962,-171,-732,-4189,12307,2099,-911,1981,6304 ], // Colin Walker

View File

@ -9175,6 +9175,7 @@ void CLASS identify()
{ 3944, 2622, 30, 18, 6, 2 },
{ 3948, 2622, 42, 18, 0, 2 },
{ 3984, 2622, 76, 20, 0, 2, 14 },
{ 4032, 2656, 112, 44, 10, 0 },
{ 4104, 3048, 48, 12, 24, 12 },
{ 4116, 2178, 4, 2, 0, 0 },
{ 4152, 2772, 192, 12, 0, 0 },