@ Nullable public static String rescaleImageAndEncodeAsBase64 ( @ Nonnull final InputStream in , final int maxSize ) throws IOException { final Image image = ImageIO . read ( in ) ; String result = null ; if ( image != null ) { result = rescaleImageAndEncodeAsBase64 ( image , maxSize ) ; } return result ; }
Load and encode image into Base64 .