public class ImageLoaderImageIO extends AbstractImageLoader
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
JPEG_METADATA_NODE |
protected static org.apache.commons.logging.Log |
log
logger
|
private static java.lang.String |
PNG_METADATA_NODE |
private static java.util.Set |
PROVIDERS_IGNORING_ICC |
private ImageFlavor |
targetFlavor |
MEDIUM_LOADING_PENALTY, NO_LOADING_PENALTY
Constructor and Description |
---|
ImageLoaderImageIO(ImageFlavor targetFlavor)
Main constructor.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
checkProviderIgnoresICC(javax.imageio.spi.IIOServiceProvider provider)
Checks if the provider ignores the ICC color profile.
|
private java.awt.image.BufferedImage |
getFallbackBufferedImage(javax.imageio.ImageReader reader,
int pageIndex,
javax.imageio.ImageReadParam param) |
private javax.imageio.ImageReadParam |
getParam(javax.imageio.ImageReader reader,
java.util.Map hints) |
ImageFlavor |
getTargetFlavor()
Returns the image flavor that is returned by this ImageLoader implementation.
|
Image |
loadImage(ImageInfo info,
java.util.Map hints,
ImageSessionContext session)
Loads and returns an image.
|
private java.awt.color.ICC_Profile |
tryToExctractICCProfile(javax.imageio.metadata.IIOMetadata iiometa)
Extract ICC Profile from ImageIO Metadata.
|
private java.awt.color.ICC_Profile |
tryToExctractICCProfileFromJPEGMetadataNode(org.w3c.dom.Element jpgNode) |
private java.awt.color.ICC_Profile |
tryToExctractICCProfileFromPNGMetadataNode(org.w3c.dom.Element pngNode) |
getUsagePenalty, ignoreColorProfile, loadImage
protected static final org.apache.commons.logging.Log log
private ImageFlavor targetFlavor
private static final java.lang.String PNG_METADATA_NODE
private static final java.lang.String JPEG_METADATA_NODE
private static final java.util.Set PROVIDERS_IGNORING_ICC
public ImageLoaderImageIO(ImageFlavor targetFlavor)
targetFlavor
- the target flavorpublic ImageFlavor getTargetFlavor()
public Image loadImage(ImageInfo info, java.util.Map hints, ImageSessionContext session) throws ImageException, java.io.IOException
info
- the image info object indicating the imagehints
- a Map of hints that can be used by implementations to customize the loading
process (may be null).session
- the session contextImageException
- if an error occurs while loading the imagejava.io.IOException
- if an I/O error occurs while loading the imageprivate javax.imageio.ImageReadParam getParam(javax.imageio.ImageReader reader, java.util.Map hints) throws java.io.IOException
java.io.IOException
private boolean checkProviderIgnoresICC(javax.imageio.spi.IIOServiceProvider provider)
provider
- the ImageIO Providerprivate java.awt.color.ICC_Profile tryToExctractICCProfile(javax.imageio.metadata.IIOMetadata iiometa)
iiometa
- The ImageIO Metadataprivate java.awt.color.ICC_Profile tryToExctractICCProfileFromPNGMetadataNode(org.w3c.dom.Element pngNode)
private java.awt.color.ICC_Profile tryToExctractICCProfileFromJPEGMetadataNode(org.w3c.dom.Element jpgNode)
private java.awt.image.BufferedImage getFallbackBufferedImage(javax.imageio.ImageReader reader, int pageIndex, javax.imageio.ImageReadParam param) throws java.io.IOException
java.io.IOException