Class JPEGImageReader
java.lang.Object
javax.imageio.ImageReader
com.twelvemonkeys.imageio.ImageReaderBase
com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader
public final class JPEGImageReader
extends com.twelvemonkeys.imageio.ImageReaderBase
A JPEG
Main features:
ImageReader
implementation based on the JRE JPEGImageReader
,
that adds support and properly handles cases where the JRE version throws exceptions.
Main features:
- Support for YCbCr JPEGs without JFIF segment (converted to RGB, using the embedded ICC profile if applicable)
- Support for CMYK JPEGs (converted to RGB by default or as CMYK, using the embedded ICC profile if applicable)
- Support for Adobe YCCK JPEGs (converted to RGB by default or as CMYK, using the embedded ICC profile if applicable)
- Support for JPEGs containing ICC profiles with interpretation other than 'Perceptual' (profile is assumed to be 'Perceptual' and used)
- Support for JPEGs containing ICC profiles with class other than 'Display' (profile is assumed to have class 'Display' and used)
- Support for JPEGs containing ICC profiles that are incompatible with stream data (image data is read, profile is ignored)
- Support for JPEGs with corrupted ICC profiles (image data is read, profile is ignored)
- Support for JPEGs with corrupted
ICC_PROFILE
segments (image data is read, profile is ignored) - Support for JPEGs using non-standard color spaces, unsupported by Java 2D (image data is read, profile is ignored)
- Issues warnings instead of throwing exceptions in cases of corrupted data where ever the image data can still be read in a reasonable way
- Support for JFIF thumbnails (even if stream contains inconsistent metadata)
- Support for JFXX thumbnails (JPEG, Indexed and RGB)
- Support for EXIF thumbnails (JPEG, RGB and YCbCr)
- Support for JPEG metadata in both standard and native formats (even if stream contains inconsistent metadata)
- Support for
javax_imageio_jpeg_image_1.0
format (currently as native format, may change in the future) - Support for illegal combinations of JFIF, Exif and Adobe markers, using "unknown" segments in the
"MarkerSequence" tag for the unsupported segments (for
javax_imageio_jpeg_image_1.0
format)
- Version:
- $Id: JPEGImageReader.java,v 1.0 24.01.11 16.37 haraldk Exp$
- Author:
- Harald Kuhr, LUT-based YCbCR conversion by Werner Randelshofer, last modified by $Author: haraldk$
-
Field Summary
Fields inherited from class com.twelvemonkeys.imageio.ImageReaderBase
imageInput
Fields inherited from class javax.imageio.ImageReader
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales
-
Method Summary
Modifier and TypeMethodDescriptionvoid
abort()
boolean
void
dispose()
int
getHeight
(int imageIndex) getImageMetadata
(int imageIndex) getImageTypes
(int imageIndex) int
getNumImages
(boolean allowSearch) int
getNumThumbnails
(int imageIndex) getRawImageType
(int imageIndex) int
getThumbnailHeight
(int imageIndex, int thumbnailIndex) int
getThumbnailWidth
(int imageIndex, int thumbnailIndex) int
getWidth
(int imageIndex) static void
protected void
processWarningOccurred
(String warning) read
(int imageIndex, ImageReadParam param) readAsRenderedImage
(int imageIndex, ImageReadParam param) boolean
readRaster
(int imageIndex, ImageReadParam param) readThumbnail
(int imageIndex, int thumbnailIndex) protected void
void
protected static void
showIt
(BufferedImage pImage, String pTitle) Methods inherited from class com.twelvemonkeys.imageio.ImageReaderBase
assertInput, checkBounds, fakeAOI, fakeSubsampling, getDestination, hasExplicitDestination, reset
Methods inherited from class javax.imageio.ImageReader
abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, checkReadParamBandSettings, clearAbortRequest, computeRegions, getAspectRatio, getAvailableLocales, getImageMetadata, getInput, getLocale, getMinIndex, getOriginatingProvider, getSourceRegion, getStreamMetadata, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, hasThumbnails, isIgnoringMetadata, isImageTiled, isRandomAccessEasy, isSeekForwardOnly, processImageComplete, processImageProgress, processImageStarted, processImageUpdate, processPassComplete, processPassStarted, processReadAborted, processSequenceComplete, processSequenceStarted, processThumbnailComplete, processThumbnailPassComplete, processThumbnailPassStarted, processThumbnailProgress, processThumbnailStarted, processThumbnailUpdate, processWarningOccurred, read, readAll, readAll, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, setInput, setInput, setLocale
-
Method Details
-
resetMembers
protected void resetMembers()- Specified by:
resetMembers
in classcom.twelvemonkeys.imageio.ImageReaderBase
-
dispose
public void dispose()- Overrides:
dispose
in classcom.twelvemonkeys.imageio.ImageReaderBase
-
getFormatName
- Overrides:
getFormatName
in classImageReader
- Throws:
IOException
-
getWidth
- Specified by:
getWidth
in classImageReader
- Throws:
IOException
-
getHeight
- Specified by:
getHeight
in classImageReader
- Throws:
IOException
-
getImageTypes
- Specified by:
getImageTypes
in classImageReader
- Throws:
IOException
-
getRawImageType
- Overrides:
getRawImageType
in classImageReader
- Throws:
IOException
-
read
- Specified by:
read
in classImageReader
- Throws:
IOException
-
setInput
- Overrides:
setInput
in classcom.twelvemonkeys.imageio.ImageReaderBase
-
getNumImages
- Overrides:
getNumImages
in classcom.twelvemonkeys.imageio.ImageReaderBase
- Throws:
IOException
-
canReadRaster
public boolean canReadRaster()- Overrides:
canReadRaster
in classImageReader
-
readRaster
- Overrides:
readRaster
in classImageReader
- Throws:
IOException
-
readAsRenderedImage
- Overrides:
readAsRenderedImage
in classImageReader
- Throws:
IOException
-
abort
public void abort()- Overrides:
abort
in classImageReader
-
getDefaultReadParam
- Overrides:
getDefaultReadParam
in classImageReader
-
readerSupportsThumbnails
public boolean readerSupportsThumbnails()- Overrides:
readerSupportsThumbnails
in classImageReader
-
getNumThumbnails
- Overrides:
getNumThumbnails
in classImageReader
- Throws:
IOException
-
getThumbnailWidth
- Overrides:
getThumbnailWidth
in classImageReader
- Throws:
IOException
-
getThumbnailHeight
- Overrides:
getThumbnailHeight
in classImageReader
- Throws:
IOException
-
readThumbnail
- Overrides:
readThumbnail
in classImageReader
- Throws:
IOException
-
getImageMetadata
- Overrides:
getImageMetadata
in classcom.twelvemonkeys.imageio.ImageReaderBase
- Throws:
IOException
-
getStreamMetadata
- Overrides:
getStreamMetadata
in classcom.twelvemonkeys.imageio.ImageReaderBase
- Throws:
IOException
-
processWarningOccurred
- Overrides:
processWarningOccurred
in classImageReader
-
showIt
-
main
- Throws:
IOException
-