Crop area not shown on File Browser window thumbnails, fixes #5440

This commit is contained in:
Ingo Weyrich
2019-09-05 12:08:36 +02:00
parent 10a346113f
commit 9165d0acb7

View File

@@ -1483,29 +1483,33 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorT
delete labView; delete labView;
delete baseImg; delete baseImg;
/*
// calculate scale
if (params.coarse.rotate == 90 || params.coarse.rotate == 270) {
myscale = scale * thumbImg->getWidth() / fh;
} else {
myscale = scale * thumbImg->getHeight() / fh;
}
myscale = 1.0 / myscale;
// apply crop // apply crop
if (params.crop.enabled) { if (params.crop.enabled) {
int ix = 0; double lscale;
for (int i=0; i<fh; i++) // calculate scale
for (int j=0; j<fw; j++) if (params.coarse.rotate == 90 || params.coarse.rotate == 270) {
if (i<params.crop.y/myscale || i>(params.crop.y+params.crop.h)/myscale || j<params.crop.x/myscale || j>(params.crop.x+params.crop.w)/myscale) { lscale = scale * thumbImg->getWidth() / fh;
readyImg->data[ix++] /= 3; } else {
readyImg->data[ix++] /= 3; lscale = scale * thumbImg->getHeight() / fh;
readyImg->data[ix++] /= 3;
} }
else
lscale = 1.0 / lscale;
int ix = 0;
for (int i = 0; i < fh; ++i) {
for (int j = 0; j < fw; ++j) {
if (i < params.crop.y * lscale || i > (params.crop.y + params.crop.h) * lscale || j < params.crop.x * lscale || j > (params.crop.x + params.crop.w) * lscale) {
readyImg->data[ix++] /= 3;
readyImg->data[ix++] /= 3;
readyImg->data[ix++] /= 3;
} else {
ix += 3; ix += 3;
} }
*/ }
}
}
return readyImg; return readyImg;
} }