Class ThumbsDBImageReader
- java.lang.Object
-
- javax.imageio.ImageReader
-
- com.twelvemonkeys.imageio.ImageReaderBase
-
- com.twelvemonkeys.imageio.plugins.thumbsdb.ThumbsDBImageReader
-
public final class ThumbsDBImageReader extends com.twelvemonkeys.imageio.ImageReaderBase
ThumbsDBImageReader- Version:
- $Id: ThumbsDBImageReader.java,v 1.0 22.jan.2007 18:49:38 haku Exp$
- Author:
- Harald Kuhr, last modified by $Author: haku$
- See Also:
CompoundDocument
, Wikipedia: Thumbs.db
-
-
Constructor Summary
Constructors Modifier Constructor Description ThumbsDBImageReader()
protected
ThumbsDBImageReader(ThumbsDBImageReaderSpi pProvider)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abort()
void
dispose()
int
getHeight(int pIndex)
java.util.Iterator<javax.imageio.ImageTypeSpecifier>
getImageTypes(int pIndex)
int
getNumImages(boolean allowSearch)
int
getWidth(int pIndex)
boolean
isLoadEagerly()
boolean
isPresent(java.lang.String pFileName)
static void
main(java.lang.String[] pArgs)
java.awt.image.BufferedImage
read(int pIndex, javax.imageio.ImageReadParam pParam)
Reads the image data from the given input stream, and returns it as aBufferedImage
.java.awt.image.BufferedImage
read(java.lang.String pName, javax.imageio.ImageReadParam pParam)
Reads the image data from the given input stream, and returns it as aBufferedImage
.protected void
resetMembers()
void
setInput(java.lang.Object input, boolean seekForwardOnly, boolean ignoreMetadata)
void
setLoadEagerly(boolean pLoadEagerly)
Instructs the reader wether it should read and cache alle thumbnails in sequence, during the first read operation.-
Methods inherited from class com.twelvemonkeys.imageio.ImageReaderBase
assertInput, checkBounds, fakeAOI, fakeSubsampling, getDestination, getImageMetadata, getStreamMetadata, hasExplicitDestination, reset, showIt
-
Methods inherited from class javax.imageio.ImageReader
abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, checkReadParamBandSettings, clearAbortRequest, computeRegions, getAspectRatio, getAvailableLocales, getDefaultReadParam, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getRawImageType, getSourceRegion, getStreamMetadata, getThumbnailHeight, getThumbnailWidth, 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, processWarningOccurred, read, readAll, readAll, readAsRenderedImage, readerSupportsThumbnails, readRaster, readThumbnail, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, setInput, setInput, setLocale
-
-
-
-
Constructor Detail
-
ThumbsDBImageReader
public ThumbsDBImageReader()
-
ThumbsDBImageReader
protected ThumbsDBImageReader(ThumbsDBImageReaderSpi pProvider)
-
-
Method Detail
-
resetMembers
protected void resetMembers()
- Specified by:
resetMembers
in classcom.twelvemonkeys.imageio.ImageReaderBase
-
dispose
public void dispose()
- Overrides:
dispose
in classcom.twelvemonkeys.imageio.ImageReaderBase
-
isLoadEagerly
public boolean isLoadEagerly()
-
setLoadEagerly
public void setLoadEagerly(boolean pLoadEagerly)
Instructs the reader wether it should read and cache alle thumbnails in sequence, during the first read operation.This is useful mainly if you need to read all the thumbnails, and you need them in random order, as it requires less repositioning in the underlying stream.
- Parameters:
pLoadEagerly
-true
if the reader should read all thumbs on first read
-
read
public java.awt.image.BufferedImage read(int pIndex, javax.imageio.ImageReadParam pParam) throws java.io.IOException
Reads the image data from the given input stream, and returns it as aBufferedImage
.- Specified by:
read
in classjavax.imageio.ImageReader
- Parameters:
pIndex
- the index of the image to readpParam
- additional parameters used while decoding, may benull
, in which case defaults will be used- Returns:
- a
BufferedImage
- Throws:
java.lang.IndexOutOfBoundsException
- ifpIndex
is out of boundsjava.lang.IllegalStateException
- if the input source has not been setjava.io.IOException
- if an error occurs during reading
-
read
public java.awt.image.BufferedImage read(java.lang.String pName, javax.imageio.ImageReadParam pParam) throws java.io.IOException
Reads the image data from the given input stream, and returns it as aBufferedImage
.- Parameters:
pName
- the name of the image to readpParam
- additional parameters used while decoding, may benull
, in which case defaults will be used- Returns:
- a
BufferedImage
- Throws:
java.io.FileNotFoundException
- if the given file name is not found in the "Catalog" entry of theCompoundDocument
java.lang.IllegalStateException
- if the input source has not been setjava.io.IOException
- if an error occurs during reading
-
abort
public void abort()
- Overrides:
abort
in classjavax.imageio.ImageReader
-
setInput
public void setInput(java.lang.Object input, boolean seekForwardOnly, boolean ignoreMetadata)
- Overrides:
setInput
in classcom.twelvemonkeys.imageio.ImageReaderBase
-
getNumImages
public int getNumImages(boolean allowSearch) throws java.io.IOException
- Overrides:
getNumImages
in classcom.twelvemonkeys.imageio.ImageReaderBase
- Throws:
java.io.IOException
-
getWidth
public int getWidth(int pIndex) throws java.io.IOException
- Specified by:
getWidth
in classjavax.imageio.ImageReader
- Throws:
java.io.IOException
-
getHeight
public int getHeight(int pIndex) throws java.io.IOException
- Specified by:
getHeight
in classjavax.imageio.ImageReader
- Throws:
java.io.IOException
-
getImageTypes
public java.util.Iterator<javax.imageio.ImageTypeSpecifier> getImageTypes(int pIndex) throws java.io.IOException
- Specified by:
getImageTypes
in classjavax.imageio.ImageReader
- Throws:
java.io.IOException
-
isPresent
public boolean isPresent(java.lang.String pFileName)
-
main
public static void main(java.lang.String[] pArgs) throws java.io.IOException
- Throws:
java.io.IOException
-
-