Example usage for org.apache.commons.imaging Imaging getBufferedImage

List of usage examples for org.apache.commons.imaging Imaging getBufferedImage

Introduction

In this page you can find the example usage for org.apache.commons.imaging Imaging getBufferedImage.

Prototype

private static BufferedImage getBufferedImage(final ByteSource byteSource, Map<String, Object> params)
            throws ImageReadException, IOException 

Source Link

Usage

From source file:editeurpanovisu.ReadWriteImage.java

public static Image readTiff(String strNomFich) throws ImageReadException, IOException {
    File file = new File(strNomFich);
    final Map<String, Object> params = new HashMap<>();

    params.put(ImagingConstants.BUFFERED_IMAGE_FACTORY, new ManagedImageBufferedImageFactory());

    final BufferedImage img = Imaging.getBufferedImage(file, params);

    Image image = SwingFXUtils.toFXImage(img, null);

    return image;
}

From source file:org.apache.commons.imaging.examples.ImageReadExample.java

public static BufferedImage imageReadExample(final File file) throws ImageReadException, IOException {
    final Map<String, Object> params = new HashMap<>();

    // set optional parameters if you like
    params.put(ImagingConstants.BUFFERED_IMAGE_FACTORY, new ManagedImageBufferedImageFactory());

    // params.put(ImagingConstants.PARAM_KEY_VERBOSE, Boolean.TRUE);

    // read image
    final BufferedImage image = Imaging.getBufferedImage(file, params);

    return image;
}

From source file:org.github.jipsg.sanselan.BaseSanselanTest.java

@Override
public BufferedImage createBufferedImage(File file) throws Exception {
    final Map<String, Object> params = new HashMap<String, Object>();
    // set optional parameters if you like
    params.put(ImagingConstants.BUFFERED_IMAGE_FACTORY, new ManagedImageBufferedImageFactory());
    // read image
    return Imaging.getBufferedImage(file, params);
}

From source file:pl.edu.icm.visnow.lib.utils.ImageUtilities.java

private static BufferedImage imageRead(final File file) throws ImageReadException, IOException {
    return Imaging.getBufferedImage(file, null);
}

From source file:pl.edu.icm.visnow.lib.utils.ImageUtilities.java

private static BufferedImage imageRead(final InputStream is) throws ImageReadException, IOException {
    return Imaging.getBufferedImage(is, null);
}