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

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

Introduction

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

Prototype

private static List<BufferedImage> getAllBufferedImages(final ByteSource byteSource)
            throws ImageReadException, IOException 

Source Link

Usage

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

/**
 * Load a multi-page TIFF image and split it into its individual pages.
 *//*from  w  ww.j  a  va2 s . com*/
@Test
public void testExtractPagesFromMultiPageTiff() throws Exception {

    File sourceImageFile = getImageFile("tiff", "test-multi-gray-compression-type-4.tiff");

    List<BufferedImage> bufferedImageList = Imaging.getAllBufferedImages(sourceImageFile);

    for (BufferedImage bufferedImage : bufferedImageList) {
        assertValidBufferedImage(bufferedImage);
    }
    assertEquals("Expect to have 2 pages", 2, bufferedImageList.size());
}