< prev index next >
test/javax/imageio/plugins/shared/BitDepth.java
Print this page
*** 128,142 ****
private void testFormat(String format) throws IOException {
boolean allOK = true;
! for (int i = 0; i < biRGBTypes.length; i++) {
!
! int type = biRGBTypes[i];
!
!
// TODO: remove the following 'if' block after the 8147448 fix
if ( format.toLowerCase().equals("bmp") && (
(type == BufferedImage.TYPE_INT_ARGB ) ||
(type == BufferedImage.TYPE_INT_ARGB_PRE ) ||
(type == BufferedImage.TYPE_4BYTE_ABGR ) ||
--- 128,138 ----
private void testFormat(String format) throws IOException {
boolean allOK = true;
! for (int type : biRGBTypes) {
// TODO: remove the following 'if' block after the 8147448 fix
if ( format.toLowerCase().equals("bmp") && (
(type == BufferedImage.TYPE_INT_ARGB ) ||
(type == BufferedImage.TYPE_INT_ARGB_PRE ) ||
(type == BufferedImage.TYPE_4BYTE_ABGR ) ||
*** 149,164 ****
}
System.out.println("Testing " + format +
" writer for type " + biTypeNames[type]);
! File f = testWriteRGB(format, type);
! boolean ok = testReadRGB(f);
if (ok) {
f.delete();
}
! allOK = allOK && ok;
}
if (format.equals("png")) {
--- 145,172 ----
}
System.out.println("Testing " + format +
" writer for type " + biTypeNames[type]);
! boolean ok = false;
! File f = null;
! try {
! f = testWriteRGB(format, type);
! ok = testReadRGB(f);
! } catch (javax.imageio.IIOException e) {
! // The follow two formats are not supported on OpenJDK
! // for jpg files.
! if (format.toLowerCase().equals("jpg") &&
! (type == BufferedImage.TYPE_4BYTE_ABGR ||
! type == BufferedImage.TYPE_4BYTE_ABGR_PRE))
! continue;
! } finally {
if (ok) {
f.delete();
}
! allOK = allOK && (ok || f == null);
! }
}
if (format.equals("png")) {
< prev index next >