public static synchronized BufferedImage loadBufferedJPEGImage(URL url){
  BufferedImage image=null;
  if (url != null) {
    try {
      image=ImageIO.read(url);
    }
 catch (    Exception e) {
      log.severe("URL: " + url + " - "+ e.getMessage());
      image=null;
    }
 finally {
    }
    if (image != null) {
      log.config("Image type : " + image.getType());
      if (image.getWidth() <= 0 || image.getHeight() <= 0) {
        log.severe("URL: " + url + " =0");
        image=null;
      }
    }
  }
  return image;
}

public static synchronized BufferedImage loadBufferedJPEGImage ( URL url ) { BufferedImage image = null ; if ( url != null ) { try { image = ImageIO . read ( url ) ; } catch ( Exception e ) { log . severe ( "URL: " + url + " - " + e . getMessage ( ) ) ; image = null ; } finally { } if ( image != null ) { log . config ( "Image type : " + image . getType ( ) ) ; if ( image . getWidth ( ) <= 0 || image . getHeight ( ) <= 0 ) { log . severe ( "URL: " + url + " =0" ) ; image = null ; } } } return image ; }
load a jpeg image from a given location .
