Package com.idrsolutions.image.webp
Class WebpDecoder
java.lang.Object
com.idrsolutions.image.JDeliImage
com.idrsolutions.image.webp.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);
-
Field Summary
Fields inherited from class com.idrsolutions.image.JDeliImage
bb
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionread
(byte[] rawData) Make NO assumptions about type of BufferedImage type returned (may change)readDimension
(byte[] rawData) Decodes and returns the width and height of webp imagereadDimension
(File file) Decodes and returns the width and height of webp imageMethods 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, getImageCount, readEmbeddedThumbnail, readEmbeddedThumbnail, readImageAt, readImageAt, readImageSpecificMetaData, readImageSpecificMetaData, setMetadata
-
Constructor Details
-
WebpDecoder
public WebpDecoder()
-
-
Method Details
-
read
Make NO assumptions about type of BufferedImage type returned (may change)Decodes and returns the WEBP image as a BufferedImage.
- Specified by:
read
in interfacecom.idrsolutions.image.Decoder
- Parameters:
rawData
- byte[] array containing the WEBP data- Returns:
- BufferedImage The decoded image
- Throws:
Exception
- if an error occurs in reading image
-
readDimension
Decodes and returns the width and height of webp image- Specified by:
readDimension
in interfacecom.idrsolutions.image.Decoder
- Parameters:
file
- image image contained in raw data if present- Returns:
- width and height of image
- Throws:
Exception
- if problem reading image
-
readDimension
Decodes and returns the width and height of webp image- Specified by:
readDimension
in interfacecom.idrsolutions.image.Decoder
- Parameters:
rawData
- image image contained in raw data if present- Returns:
- Rectangle width and height of image
- Throws:
Exception
- if problem reading image
-
read
- Specified by:
read
in interfacecom.idrsolutions.image.Decoder
- Throws:
Exception
-