@ Nonnull public static String rescaleImageAndEncodeAsBase64 ( @ Nonnull final File file , final int maxSize ) throws IOException { final Image image = ImageIO . read ( file ) ; if ( image == null ) { throw new IllegalArgumentException ( "Can't load image file : " + file ) ; //NOI18N } return rescaleImageAndEncodeAsBase64 ( image , maxSize ) ; }
Load and encode image into Base64 from file .