code: public static String getImageAsDataUri(File file) throws IOException {
          String contentType = getContentType(file);
          String base64Content = getImageAsBase64(file);
  
          return "data:" + contentType + ";base64," + base64Content;
      }
docs: Gets the content of an image as a data URI; e.g. "data:image/png;base64,iVBORw0KGgoAA..."
  
  @param   file        a File pointing to an image
  @return              a data URI
  @throws IOException  if there is an error reading the file