List of usage examples for org.apache.commons.imaging Imaging getImageInfo
private static ImageInfo getImageInfo(final ByteSource byteSource, final Map<String, Object> params) throws ImageReadException, IOException
From source file:com.vividsolutions.jump.workbench.imagery.graphic.CommonsImage.java
protected void initImage() throws ReferencedImageException { BufferedImage image = getImage(); if (image != null) return;/*from w ww . ja va 2 s . com*/ String uri = getUri(); try { is = CompressedFile.openFile(uri); ImageInfo info = Imaging.getImageInfo(is, UriUtil.getFileName(CompressedFile.getTargetFileWithPath(new URI(uri)))); type = info.getFormatName(); close(is); is = CompressedFile.openFile(uri); image = Imaging.getBufferedImage(is); close(is); setImage(image); } catch (Exception e) { throw new ReferencedImageException(e); } finally { close(is); } }