Fixed issue #6312
Fixed issue, where raw cropped Fuji X-Pro3 could not be loaded correctly. This would result in a Segmentation Fault. With these changes the program should read the correct dimensions from the file's metadata, and load the image accordingly.
This commit is contained in:
@@ -560,6 +560,13 @@ int RawImage::loadRaw(bool loadData, unsigned int imageNum, bool closeFile, Prog
|
||||
raw_crop_cc = true;
|
||||
int lm, tm, w, h;
|
||||
cc->get_rawCrop(raw_width, raw_height, lm, tm, w, h);
|
||||
is_cropped = read_crop.complete && (raw_width - read_crop.width > is_cropped_margin || raw_height - read_crop.height > is_cropped_margin);
|
||||
if (is_cropped){
|
||||
left_margin = read_crop.left_margin;
|
||||
top_margin = read_crop.top_margin;
|
||||
tm = 0;
|
||||
lm = 0;
|
||||
}
|
||||
|
||||
if (isXtrans()) {
|
||||
shiftXtransMatrix(6 - ((top_margin - tm) % 6), 6 - ((left_margin - lm) % 6));
|
||||
@@ -569,8 +576,10 @@ int RawImage::loadRaw(bool loadData, unsigned int imageNum, bool closeFile, Prog
|
||||
}
|
||||
}
|
||||
|
||||
left_margin = lm;
|
||||
top_margin = tm;
|
||||
if (!is_cropped) {
|
||||
left_margin = lm;
|
||||
top_margin = tm;
|
||||
}
|
||||
|
||||
if (w < 0) {
|
||||
iwidth += w;
|
||||
|
Reference in New Issue
Block a user