code: public static String getBase64EncodedImage(String imgSrc, BinaryResourcesHandler binaryRsHandler,
  			HttpServletRequest request) {
  
  		String encodedResult = null;
  		if (null == binaryRsHandler) {
  			throw new JawrLinkRenderingException(
  					"You are using a Jawr image tag while the Jawr Image servlet has not been initialized. Initialization of Jawr Image servlet either failed or never occurred.");
  		}
  
  		imgSrc = getFullImagePath(imgSrc, binaryRsHandler, request);
  
  		encodedResult = binaryRsHandler.getCacheUrl(BASE64_KEY_PREFIX + imgSrc);
  		if (encodedResult == null) {
  			try {
  				String fileExtension = FileNameUtils.getExtension(imgSrc);
  				String fileMimeType = (String) MIMETypesSupport.getSupportedProperties(ImageTagUtils.class)
  						.get(fileExtension);
  
  				InputStream is = binaryRsHandler.getRsReaderHandler().getResourceAsStream(imgSrc);
  
  				ByteArrayOutputStream out = new ByteArrayOutputStream();
  				IOUtils.copy(is, out, true);
  				byte[] data = out.toByteArray();
  				encodedResult = new String(Base64Encoder.encode(data));
  				encodedResult = DATA_PREFIX + fileMimeType + ";base64," + encodedResult;
  				binaryRsHandler.addMapping(BASE64_KEY_PREFIX + imgSrc, encodedResult);
  			} catch (ResourceNotFoundException e) {
  				LOGGER.warn("Unable to find the image '" + imgSrc + "' while generating image tag.");
  			} catch (IOException e) {
  				LOGGER.warn("Unable to copy the image '" + imgSrc + "' while generating image tag.");
  			}
  		}
  
  		return encodedResult;
  	}
docs: Returns the base64 image of the image path given in parameter
  
  @param imgSrc
  the image path
  @param binaryRsHandler
  the binary resource handler
  
  @param request
  the HTTP request
  @return he base64 image of the image path given in parameter
  @throws JawrLinkRenderingException
  if an exception occurs