Skip to content

Commit

Permalink
TIFF plugin: accept byte-type for fields in getAsInts
Browse files Browse the repository at this point in the history
  • Loading branch information
MichiHo committed Feb 23, 2024
1 parent 89314b7 commit 6bc5bf1
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -868,9 +868,16 @@ public int[] getAsInts() {
idata[i] = (int)sdata[i];
}
return idata;
} else if (data instanceof byte[]) {
byte[] bdata = (byte[])data;
int[] idata = new int[bdata.length];
for (int i = 0; i < bdata.length; i++) {
idata[i] = (int)(bdata[i] & 0xff);
}
return idata;
} else {
throw new ClassCastException(
"Data not char[], short[], or int[]!");
"Data not char[], short[], int[] or byte[]!");
}
}

Expand Down

0 comments on commit 6bc5bf1

Please sign in to comment.