public static ImageReader getImageReader ( final Object sourceImage ) throws IOException { ImageInputStream imageInputStream = ImageIO . createImageInputStream ( sourceImage ) ; Iterator < ImageReader > imageReaders = ImageIO . getImageReaders ( imageInputStream ) ; ImageReader destinationImageReader = null ; if ( imageReaders . hasNext ( ) ) { destinationImageReader = imageReaders . next ( ) ; setImageReaderHaveInputStream ( destinationImageReader , imageInputStream ) ; } return destinationImageReader ; }
Get image reader from given source image .