fix pixelsize=2 imOut offsets in ImagingReduceCorners()

This commit is contained in:
Yay295 2022-08-25 10:11:42 -05:00
parent 87e9ab01fe
commit 0d56474150

View File

@ -1157,8 +1157,8 @@ ImagingReduceCorners(Imaging imOut, Imaging imIn, int box[4], int xscale, int ys
ss1 += line[xx * 2 + 1];
}
}
((UINT8 *)imOut->image[y])[x + 0] = (ss0 * multiplier) >> 24;
((UINT8 *)imOut->image[y])[x + 1] = (ss1 * multiplier) >> 24;
((UINT8 *)imOut->image[y])[x * 2 + 0] = (ss0 * multiplier) >> 24;
((UINT8 *)imOut->image[y])[x * 2 + 1] = (ss1 * multiplier) >> 24;
}
}
if (box[3] % yscale) {
@ -1176,8 +1176,8 @@ ImagingReduceCorners(Imaging imOut, Imaging imIn, int box[4], int xscale, int ys
ss1 += line[xx * 2 + 1];
}
}
((UINT8 *)imOut->image[y])[x + 0] = (ss0 * multiplier) >> 24;
((UINT8 *)imOut->image[y])[x + 1] = (ss1 * multiplier) >> 24;
((UINT8 *)imOut->image[y])[x * 2 + 0] = (ss0 * multiplier) >> 24;
((UINT8 *)imOut->image[y])[x * 2 + 1] = (ss1 * multiplier) >> 24;
}
}
if (box[2] % xscale && box[3] % yscale) {
@ -1194,8 +1194,8 @@ ImagingReduceCorners(Imaging imOut, Imaging imIn, int box[4], int xscale, int ys
ss1 += line[xx * 2 + 1];
}
}
((UINT8 *)imOut->image[y])[x + 0] = (ss0 * multiplier) >> 24;
((UINT8 *)imOut->image[y])[x + 1] = (ss1 * multiplier) >> 24;
((UINT8 *)imOut->image[y])[x * 2 + 0] = (ss0 * multiplier) >> 24;
((UINT8 *)imOut->image[y])[x * 2 + 1] = (ss1 * multiplier) >> 24;
}
} else if (imIn->pixelsize == 4) {
if (box[2] % xscale) {