Example usage for org.apache.commons.imaging.formats.tiff TiffImageParser TiffImageParser

List of usage examples for org.apache.commons.imaging.formats.tiff TiffImageParser TiffImageParser

Introduction

In this page you can find the example usage for org.apache.commons.imaging.formats.tiff TiffImageParser TiffImageParser.

Prototype

public TiffImageParser() 

Source Link

Usage

From source file:org.libimobiledevice.ios.driver.binding.services.ScreenshotService.java

private byte[] getPNGAsString() throws SDKException, ImageReadException, IOException {
    byte[] raw = takeScreenshotAsTiff();

    TiffImageParser parser = new TiffImageParser();
    BufferedImage image = parser.getBufferedImage(raw, new HashMap<String, Object>());
    File f = new File("screen.png");
    //System.out.println("loading :\t" + (System.currentTimeMillis() - start) + " ms");
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    ImageIO.write(image, "png", out);
    out.flush();//w  w w .  j  av  a 2  s  .  com
    return out.toByteArray();
}