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
Constructors -
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 imagevoidreadImageSpecificMetaData(byte[] bytes, Metadata metadata) Read WEBP specific metadatavoidreadImageSpecificMetaData(File file, Metadata metadata) Read WEBP specific metadataMethods inherited from class com.idrsolutions.image.JDeliImage
optimiseImageMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.idrsolutions.image.Decoder
getImageCount, getImageCount, readEmbeddedThumbnail, readEmbeddedThumbnail, readImageAt, readImageAt, 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:
readin 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:
readDimensionin 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:
readDimensionin 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:
readin interfacecom.idrsolutions.image.Decoder- Throws:
Exception
-
readImageSpecificMetaData
Read WEBP specific metadata- Specified by:
readImageSpecificMetaDatain interfacecom.idrsolutions.image.Decoder- Parameters:
bytes- byte array to read data frommetadata- image metadata object to hold all metadata- Throws:
Exception
-
readImageSpecificMetaData
Read WEBP specific metadata- Specified by:
readImageSpecificMetaDatain interfacecom.idrsolutions.image.Decoder- Parameters:
file- file to read frommetadata- image metadata object to hold all metadata- Throws:
Exception
-