< prev index next >
test/javax/imageio/plugins/bmp/BMP8BPPLoadTest.java
Print this page
*** 21,53 ****
* questions.
*/
/**
* @test
! * @bug 8182461
* @summary Test verifies that the 8BPP indexed color BMP image file is read properly
- * @requires BMP8BPPLoadTest.PNG
* @run main BMP8BPPLoadTest
- * @author fairoz.matte
*/
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
-
public class BMP8BPPLoadTest {
public BMP8BPPLoadTest() throws IOException {
try {
! BufferedImage image = ImageIO.read(new File("BMP8BPPLoadTest.bmp"));
System.out.println("Test Passed ImageIO.read able to read the file");
} catch (IndexOutOfBoundsException iobe) {
System.out.println("Test Failed with ImageIO.read throwing IndexOutOfBoundsException");
}
}
public static void main(String args[]) throws IOException{
BMP8BPPLoadTest test = new BMP8BPPLoadTest();
}
}
--- 21,92 ----
* questions.
*/
/**
* @test
! * @bug 8182461, 8212914
* @summary Test verifies that the 8BPP indexed color BMP image file is read properly
* @run main BMP8BPPLoadTest
*/
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
+ import java.io.ByteArrayInputStream;
import javax.imageio.ImageIO;
public class BMP8BPPLoadTest {
public BMP8BPPLoadTest() throws IOException {
try {
! ImageIO.read(ImageIO.createImageInputStream(new ByteArrayInputStream(BMP8BPPIMAGE)));
System.out.println("Test Passed ImageIO.read able to read the file");
} catch (IndexOutOfBoundsException iobe) {
System.out.println("Test Failed with ImageIO.read throwing IndexOutOfBoundsException");
+ throw new RuntimeException("Test failed: ImageIO.read throwing IndexOutOfBoundsException");
}
}
public static void main(String args[]) throws IOException{
BMP8BPPLoadTest test = new BMP8BPPLoadTest();
}
+
+ public static byte[] BMP8BPPIMAGE = {
+ (byte)0x42, (byte)0x4d, (byte)0x1a, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0xca, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x7c, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x0f, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x0a, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x50, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x13, (byte)0x0b,
+ (byte)0x00, (byte)0x00, (byte)0x13, (byte)0x0b, (byte)0x00, (byte)0x00, (byte)0x10, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x10, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0xff, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0x42, (byte)0x47,
+ (byte)0x52, (byte)0x73, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0xc0, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0xff,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x40, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0xff, (byte)0x00, (byte)0xff, (byte)0x00, (byte)0xfc, (byte)0x00, (byte)0x00, (byte)0xff,
+ (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11,
+ (byte)0x11, (byte)0x10, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11,
+ (byte)0x11, (byte)0x10, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11,
+ (byte)0x11, (byte)0x10, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11,
+ (byte)0x11, (byte)0x10, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11,
+ (byte)0x11, (byte)0x10, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11,
+ (byte)0x11, (byte)0x10, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11,
+ (byte)0x11, (byte)0x10, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11,
+ (byte)0x11, (byte)0x10, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11,
+ (byte)0x11, (byte)0x10, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11,
+ (byte)0x11, (byte)0x10
+ };
}
< prev index next >