Error added: 2013-01-06T17:33:05Z
try (InputStream inputStream = new ByteArrayInputStream(data)) { BufferedImage originalImage = ImageIO.read(inputStream); int w = originalImage.getWidth(); int h = originalImage.getHeight(); BufferedImage newImage = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); int[] rgb = originalImage.getRGB(0, 0, w, h, null, 0, w); newImage.setRGB(0, 0, w, h, rgb, 0, w); return newImage; } catch (IOException e) { throw new RuntimeException(e); }
If you know the answer, please add your own solution below.
If you don't know, but find out later, please come back and share your answer - there will be other people
struggling with this too.
If you want to be notified via email when this is solved, enter your email address here: