Skip to content

Commit

Permalink
Fix float casting when autoscaling int values to byte
Browse files Browse the repository at this point in the history
Fixes ome#4210.
  • Loading branch information
melissalinkert committed Aug 6, 2024
1 parent 0a895ae commit be170f3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,7 @@ else if (pixels instanceof int[][]) {
else if (ints[i][j] <= min) out[i][j] = 0;
else {
int diff = max - min;
float dist = (ints[i][j] - min) / diff;
float dist = (float) (ints[i][j] - min) / diff;
out[i][j] = (byte) (dist * 256);
}
}
Expand Down

0 comments on commit be170f3

Please sign in to comment.