Package com.idrsolutions.image.jpeg
Class JpegDecoder
java.lang.Object
com.idrsolutions.image.JDeliImage
com.idrsolutions.image.jpeg.JpegDecoder
- All Implemented Interfaces:
com.idrsolutions.image.Decoder
public class JpegDecoder
extends com.idrsolutions.image.JDeliImage
implements com.idrsolutions.image.Decoder
Class reads JPEG image as BufferedImage // Make NO assumptions about type of BufferedImage type returned (may
change)
Example:
JpegDecoder decoder = new JpegDecoder();
BufferedImage decodedImage = decoder.read(jpegByteData);
-
Field Summary
FieldsFields inherited from class com.idrsolutions.image.JDeliImage
bb -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddecodeSamplesWithOutputBytes(com.idrsolutions.image.jpeg.data.Info info, byte[] output) read(byte[] jpegRawData) Make NO assumptions about BufferedImage type returned as it may changeMake NO assumptions about BufferedImage type returned as it may changebyte[]readAsUnconvertedBytes(byte[] jpegRawData, int adobeColorTransform, com.idrsolutions.image.jpeg.data.Info info) Not recommended for external use.byte[]readComponentsAsRawBytes(byte[] jpegRawData) Not recommended for external use.readDimension(byte[] jpegRawData) Decodes and returns the width and height of jpeg imagereadDimension(File file) Decodes and returns the width and height of jpeg imagereadEmbeddedThumbnail(byte[] data) Decodes and returns the thumbnail heic image as BufferedImage if there is an thumbnail otherwise returns nullreadEmbeddedThumbnail(File file) Decodes and returns the thumbnail heic image as BufferedImage if there is an thumbnail otherwise returns nullvoidreadImageSpecificMetaData(byte[] bytes, com.idrsolutions.image.metadata.Metadata metadata) Read JPEG specific metadatavoidreadImageSpecificMetaData(File file, com.idrsolutions.image.metadata.Metadata metadata) Read JPEG 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, readImageAt, readImageAt, setMetadata
-
Field Details
-
ZIGZAGORDER
public static final byte[] ZIGZAGORDER
-
-
Constructor Details
-
JpegDecoder
public JpegDecoder()
-
-
Method Details
-
read
Make NO assumptions about BufferedImage type returned as it may changeDecodes and returns the JPEG image as a BufferedImage from bytes
- Specified by:
readin interfacecom.idrsolutions.image.Decoder- Parameters:
jpegRawData- byte[] containing the JPEG data to be decoded- Returns:
- BufferedImage The decoded image
- Throws:
Exception- if an error occurs in reading image
-
read
Make NO assumptions about BufferedImage type returned as it may changeDecodes and returns the JPEG image as a BufferedImage from bytes
- Specified by:
readin interfacecom.idrsolutions.image.Decoder- Parameters:
file- file containing the JPEG data to be decoded- Returns:
- BufferedImage The decoded image
- Throws:
Exception- if an error occurs in reading image
-
readDimension
Decodes and returns the width and height of jpeg 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 jpeg image- Specified by:
readDimensionin interfacecom.idrsolutions.image.Decoder- Parameters:
jpegRawData- image image contained in raw data if present- Returns:
- Rectangle width and height of image
- Throws:
Exception- if problem reading image
-
readEmbeddedThumbnail
Decodes and returns the thumbnail heic image as BufferedImage if there is an thumbnail otherwise returns null- Specified by:
readEmbeddedThumbnailin interfacecom.idrsolutions.image.Decoder- Parameters:
file- jpeg file- Returns:
- BufferedImage thumbnail image
- Throws:
Exception- if problem reading image
-
readEmbeddedThumbnail
Decodes and returns the thumbnail heic image as BufferedImage if there is an thumbnail otherwise returns null- Specified by:
readEmbeddedThumbnailin interfacecom.idrsolutions.image.Decoder- Parameters:
data- jpeg bytes- Returns:
- BufferedImage thumbnail image
- Throws:
Exception- if problem reading image
-
readImageSpecificMetaData
public void readImageSpecificMetaData(byte[] bytes, com.idrsolutions.image.metadata.Metadata metadata) throws Exception Read JPEG 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
public void readImageSpecificMetaData(File file, com.idrsolutions.image.metadata.Metadata metadata) throws Exception Read JPEG specific metadata- Specified by:
readImageSpecificMetaDatain interfacecom.idrsolutions.image.Decoder- Parameters:
file- file to read frommetadata- image metadata object to hold all metadata- Throws:
Exception
-
readComponentsAsRawBytes
Not recommended for external use.Decodes JPEG image data as non converted bytes. Please note this method does not perform YCBCR/CMYK/YCCK to RGB/gray conversion.
- Parameters:
jpegRawData- byte[] containing the raw JPEG data- Returns:
- byte[] YCBCR converted data of the JPEG
- Throws:
Exception- Provides for different exceptions thrown under the Java.Lang package
-
readAsUnconvertedBytes
public byte[] readAsUnconvertedBytes(byte[] jpegRawData, int adobeColorTransform, com.idrsolutions.image.jpeg.data.Info info) throws Exception Not recommended for external use.Decodes JPEG image data as un-converted(RGB/gray) bytes
- Parameters:
jpegRawData- byte[] array containing the un-converted JPEG bytesadobeColorTransform- colorspace as defined by Adobe specinfo- values found in image header- Returns:
- converted JPEG byte[]
- Throws:
Exception- Provides for different exceptions thrown under java Lang package
-
decodeSamplesWithOutputBytes
public static void decodeSamplesWithOutputBytes(com.idrsolutions.image.jpeg.data.Info info, byte[] output)
-