private static ImageSource createImageSource(InputStream in, Source source) { try { //Buffer and uncompress if necessary return new ImageSource(createImageInputStream(ImageUtil.autoDecorateInputStream(in)), source.getSystemId(), false); } catch (IOException ioe) { log.error("Unable to create ImageInputStream for InputStream" + " from system identifier '" + source.getSystemId() + "' (" + ioe.getMessage() + ")"); } return null; }
return null; } else { imageSource = new ImageSource(newInputStream, resolvedURI, true);