Class ImageUtil


  • public class ImageUtil
    extends java.lang.Object
    Util class to provide basic image functionality like converting image data to base64 content
    Since:
    6.20.0
    Author:
    Tobias Soloschenko
    • Constructor Summary

      Constructors 
      Constructor Description
      ImageUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.CharSequence createBase64EncodedImage​(PackageResourceReference imageReference, boolean removeWhitespaces)
      Creates a base64 encoded image string based on the given image reference
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ImageUtil

        public ImageUtil()
    • Method Detail

      • createBase64EncodedImage

        public static java.lang.CharSequence createBase64EncodedImage​(PackageResourceReference imageReference,
                                                                      boolean removeWhitespaces)
                                                               throws org.apache.wicket.util.resource.ResourceStreamNotFoundException,
                                                                      java.io.IOException
        Creates a base64 encoded image string based on the given image reference
        Parameters:
        imageReference - the image reference to create the base64 encoded image string of
        removeWhitespaces - if whitespaces should be removed from the output
        Returns:
        the base64 encoded image string
        Throws:
        org.apache.wicket.util.resource.ResourceStreamNotFoundException - if the resource couldn't be found
        java.io.IOException - if the stream couldn't be read