wbmp files have black area after reading
See original GitHub issueHappens with 3.7.0 but not with 3.6.4. The pom.xml has imageio-jpeg. Using windows 10 and oracle jdk8 almost latest.
@Test
public void wbmpTest() throws IOException
{
BufferedImage bw = new BufferedImage(500, 500, BufferedImage.TYPE_BYTE_BINARY);
Graphics2D g = (Graphics2D) bw.getGraphics();
g.setBackground(Color.white);
g.fillRect(0, 0, bw.getWidth(), bw.getHeight());
g.dispose();
boolean b = ImageIO.write(bw, "wbmp", new File("target","test2.wbmp"));
Assert.assertTrue(b);
BufferedImage bim2 = ImageIO.read(new File("target","test2.wbmp"));
b = ImageIO.write(bim2, "wbmp", new File("target","test3.wbmp"));
Assert.assertTrue(b);
for (int x = 0; x < bim2.getWidth(); ++x)
{
for (int y = 0; y < bim2.getHeight(); ++y)
{
Assert.assertEquals("Difference at " + x + "," + y, bim2.getRGB(x, y), bw.getRGB(x, y));
}
}
}
Original file is white, second file is black and white.
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Black result image problem on BMP image resize using PHP
Calling imagecreatefromwbmp($file) where $file is a .bmp will fail every time. See this thread for info on how to load a .bmp file....
Read more >WBMP File Extension - What is it? How to open a WBMP file?
WBMP files mostly belong to Photoshop by Adobe. WBMP is the filename extension of bi-level (black and white) images stored in the Wireless...
Read more >Wireless Application Protocol Bitmap Format - Wikipedia
WBMP images are monochrome (black & white) so that the image size is kept to a minimum. A black pixel is denoted by...
Read more >Optimize WBMPs - Photoshop Tips
From the File Type menu, select WBMP. Because WBMP files only contain two colors (black and white), you don't have any options regarding ......
Read more >WAP / WBMP Sequencer
Well.. if you have vector animation that can be scaled down to fit in a 96x44 pixel area, group and scale it down,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
They fixed it for jdk18.
Thanks @THausherr for registering all those bug reports and creating a good test case! 👍🏻