Package com.idrsolutions.image.png
Class PngDecoder
java.lang.Object
com.idrsolutions.image.JDeliImage
com.idrsolutions.image.png.PngDecoder
- All Implemented Interfaces:
- com.idrsolutions.image.Decoder
public class PngDecoder
extends com.idrsolutions.image.JDeliImage
implements com.idrsolutions.image.Decoder
Class reads PNG images as BufferedImage.
 Make NO assumptions about the type of
 BufferedImage type returned (it may change)
 
Example 1 (Using raw byte data):
 PngDecoder decoder = new PngDecoder();
 BufferedImage decodedImage = decoder.read(pngByteData);
 
 File pngFile = new File("C:\\path\\to\\output\\file.png");
 PngDecoder decoder = new PngDecoder();
 BufferedImage decodedImage = decoder.read(pngFile);
 - 
Field SummaryFields inherited from class com.idrsolutions.image.JDeliImagebb
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionread(byte[] pngRawData) Decodes and returns the PNG image as a BufferedImage from bytesDecodes and returns the PNG image as a BufferedImage from a FilereadDimension(byte[] pngRawData) Decodes and returns the width and height of png imagereadDimension(File file) Decodes and returns the width and height of png imagevoidreadImageSpecificMetaData(byte[] bytes, Metadata metadata) Read PNG specific metadatavoidreadImageSpecificMetaData(File file, Metadata metadata) Read PNG specific metadataMethods inherited from class com.idrsolutions.image.JDeliImageoptimiseImageMethods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.idrsolutions.image.DecodergetImageCount, getImageCount, readEmbeddedThumbnail, readEmbeddedThumbnail, readImageAt, readImageAt, setMetadata
- 
Constructor Details- 
PngDecoderpublic PngDecoder()
 
- 
- 
Method Details- 
readDecodes and returns the PNG image as a BufferedImage from bytes- Specified by:
- readin interface- com.idrsolutions.image.Decoder
- Parameters:
- pngRawData- byte[] containing the PNG data to be decoded
- Returns:
- BufferedImage The decoded image
- Throws:
- Exception- if an error occurs in reading image
 
- 
readDecodes and returns the PNG image as a BufferedImage from a File- Specified by:
- readin interface- com.idrsolutions.image.Decoder
- Parameters:
- file- input image file to be decoded
- Returns:
- BufferedImage decoded image
- Throws:
- Exception- if an error occurs in reading image
 
- 
readDimensionDecodes and returns the width and height of png image- Specified by:
- readDimensionin interface- com.idrsolutions.image.Decoder
- Parameters:
- file- image contained in raw data if present
- Returns:
- width and height of image
- Throws:
- Exception- if problem reading image
 
- 
readDimensionDecodes and returns the width and height of png image- Specified by:
- readDimensionin interface- com.idrsolutions.image.Decoder
- Parameters:
- pngRawData- image contained in raw data if present
- Returns:
- Rectangle width and height of image
- Throws:
- Exception- if problem reading image
 
- 
readImageSpecificMetaDataRead PNG specific metadata- Specified by:
- readImageSpecificMetaDatain interface- com.idrsolutions.image.Decoder
- Parameters:
- bytes- byte array to read data from
- metadata- image metadata object to hold all metadata
- Throws:
- Exception
 
- 
readImageSpecificMetaDataRead PNG specific metadata- Specified by:
- readImageSpecificMetaDatain interface- com.idrsolutions.image.Decoder
- Parameters:
- file- file to read from
- metadata- image metadata object to hold all metadata
- Throws:
- Exception
 
 
-