Skip to content

Commit be170f3

Browse files
Fix float casting when autoscaling int values to byte
Fixes #4210.
1 parent 0a895ae commit be170f3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

components/formats-bsd/src/loci/formats/gui/AWTImageTools.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,7 @@ else if (pixels instanceof int[][]) {
16551655
else if (ints[i][j] <= min) out[i][j] = 0;
16561656
else {
16571657
int diff = max - min;
1658-
float dist = (ints[i][j] - min) / diff;
1658+
float dist = (float) (ints[i][j] - min) / diff;
16591659
out[i][j] = (byte) (dist * 256);
16601660
}
16611661
}

0 commit comments

Comments
 (0)