Changed crop detection mechanism according to code review comment

Changed the crop detection to use the CropMode Fujifilm tag from the makernotes instead of an arbitrary threshold.
This commit is contained in:
Battyányi Dániel
2023-09-11 22:58:24 +02:00
parent ea86a14dff
commit 3806107315
3 changed files with 18 additions and 20 deletions

View File

@@ -76,22 +76,20 @@ public:
}
protected:
enum CropMode : std::uint_fast16_t { // RT
NA = 0, // RT
FullFrameOnGfx = 1, // RT
SportsFinderMode = 2, // RT
ElectronicShutter1_25xCrop = 4 // RT
}; // RT
// stores the cropdata read from the file RT
struct CropData { // RT
std::uint_fast16_t width, // RT
height, // RT
top_margin, // RT
left_margin; // RT
bool complete = false; // RT
CropMode crop_mode = NA; // RT
} read_crop; // RT
/* RT
If the difference between the read dimension (width /height) RT
and the constant dimension (eg.: from cameraconstants) RT
is greater than this amount, RT
then the file should be considered raw cropped (for fuji cropped raw) RT
*/ // RT
static constexpr std::uint_fast16_t is_cropped_margin = 500; // RT
bool is_cropped = false; // RT
int exif_base, ciff_base, ciff_len;
rtengine::IMFILE *ifp;
FILE *ofp;