Class WebpDecoder

  • All Implemented Interfaces:
    com.idrsolutions.image.Decoder

    public class WebpDecoder
    extends com.idrsolutions.image.JDeliImage
    implements com.idrsolutions.image.Decoder
    Class reads lossy WEBP images as BufferedImage // Make NO assumptions about type of BufferedImage type returned (may change)

    Example:

    
     WebpDecoder decoder = new WebpDecoder();
     BufferedImage decodedImage = decoder.read(webpByteData);
     
    • Constructor Summary

      Constructors 
      Constructor Description
      WebpDecoder()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.image.BufferedImage read​(byte[] rawData)
      Make NO assumptions about type of BufferedImage type returned (may change)
      java.awt.image.BufferedImage read​(java.io.File imageFile)  
      • Methods inherited from class com.idrsolutions.image.JDeliImage

        optimiseImage
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.idrsolutions.image.Decoder

        getImageCount, readImageAt, setMetadata
    • Constructor Detail

      • WebpDecoder

        public WebpDecoder()
    • Method Detail

      • read

        public java.awt.image.BufferedImage read​(byte[] rawData)
                                          throws java.lang.Exception
        Make NO assumptions about type of BufferedImage type returned (may change)

        Decodes and returns the WEBP image as a BufferedImage.

        Specified by:
        read in interface com.idrsolutions.image.Decoder
        Parameters:
        rawData - byte[] array containing the WEBP data
        Returns:
        BufferedImage The decoded image
        Throws:
        java.lang.Exception
      • read

        public java.awt.image.BufferedImage read​(java.io.File imageFile)
                                          throws java.lang.Exception
        Specified by:
        read in interface com.idrsolutions.image.Decoder
        Throws:
        java.lang.Exception