List of usage examples for java.awt.image RenderedImage getMinX
int getMinX();
From source file:org.gbif.portal.util.image.ImageUtils.java
/** * Return true if the URL resolves to an image (rather than e.g. a web * page or application launcher.// w w w . j ava 2 s. c o m * * @param url * @return true if image is loadable */ public static boolean isImageLoadable(String url) { try { RenderedImage image = ImageIO.read(new URL(url)); image.getMinX(); } catch (Exception e) { return false; } catch (Throwable e) { logger.warn("JAI is not functioning correctly - Ignoring: " + e.getMessage()); // happens when the JAI is not working.... no reason to know it is bust return true; } return true; }