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_PROFILEsegments (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.0format (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.0format)
- 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
imageInputFields inherited from class javax.imageio.ImageReader
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()booleanvoiddispose()intgetHeight(int imageIndex) getImageMetadata(int imageIndex) getImageTypes(int imageIndex) intgetNumImages(boolean allowSearch) intgetNumThumbnails(int imageIndex) getRawImageType(int imageIndex) intgetThumbnailHeight(int imageIndex, int thumbnailIndex) intgetThumbnailWidth(int imageIndex, int thumbnailIndex) intgetWidth(int imageIndex) static voidprotected voidprocessWarningOccurred(String warning) read(int imageIndex, ImageReadParam param) readAsRenderedImage(int imageIndex, ImageReadParam param) booleanreadRaster(int imageIndex, ImageReadParam param) readThumbnail(int imageIndex, int thumbnailIndex) protected voidvoidprotected static voidshowIt(BufferedImage pImage, String pTitle) Methods inherited from class com.twelvemonkeys.imageio.ImageReaderBase
assertInput, checkBounds, fakeAOI, fakeSubsampling, getDestination, hasExplicitDestination, resetMethods 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:
resetMembersin classcom.twelvemonkeys.imageio.ImageReaderBase
-
dispose
public void dispose()- Overrides:
disposein classcom.twelvemonkeys.imageio.ImageReaderBase
-
getFormatName
- Overrides:
getFormatNamein classImageReader- Throws:
IOException
-
getWidth
- Specified by:
getWidthin classImageReader- Throws:
IOException
-
getHeight
- Specified by:
getHeightin classImageReader- Throws:
IOException
-
getImageTypes
- Specified by:
getImageTypesin classImageReader- Throws:
IOException
-
getRawImageType
- Overrides:
getRawImageTypein classImageReader- Throws:
IOException
-
read
- Specified by:
readin classImageReader- Throws:
IOException
-
setInput
- Overrides:
setInputin classcom.twelvemonkeys.imageio.ImageReaderBase
-
getNumImages
- Overrides:
getNumImagesin classcom.twelvemonkeys.imageio.ImageReaderBase- Throws:
IOException
-
canReadRaster
public boolean canReadRaster()- Overrides:
canReadRasterin classImageReader
-
readRaster
- Overrides:
readRasterin classImageReader- Throws:
IOException
-
readAsRenderedImage
- Overrides:
readAsRenderedImagein classImageReader- Throws:
IOException
-
abort
public void abort()- Overrides:
abortin classImageReader
-
getDefaultReadParam
- Overrides:
getDefaultReadParamin classImageReader
-
readerSupportsThumbnails
public boolean readerSupportsThumbnails()- Overrides:
readerSupportsThumbnailsin classImageReader
-
getNumThumbnails
- Overrides:
getNumThumbnailsin classImageReader- Throws:
IOException
-
getThumbnailWidth
- Overrides:
getThumbnailWidthin classImageReader- Throws:
IOException
-
getThumbnailHeight
- Overrides:
getThumbnailHeightin classImageReader- Throws:
IOException
-
readThumbnail
- Overrides:
readThumbnailin classImageReader- Throws:
IOException
-
getImageMetadata
- Overrides:
getImageMetadatain classcom.twelvemonkeys.imageio.ImageReaderBase- Throws:
IOException
-
getStreamMetadata
- Overrides:
getStreamMetadatain classcom.twelvemonkeys.imageio.ImageReaderBase- Throws:
IOException
-
processWarningOccurred
- Overrides:
processWarningOccurredin classImageReader
-
showIt
-
main
- Throws:
IOException
-