question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

wbmp files have black area after reading

See original GitHub issue

Happens 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:closed
  • Created 2 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
THausherrcommented, Dec 2, 2021

They fixed it for jdk18.

1reaction
haraldkcommented, May 3, 2021

Thanks @THausherr for registering all those bug reports and creating a good test case! 👍🏻

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found