Package com.day.cq.dam.commons.handler
Class StandardImageHandler
- java.lang.Object
-
- com.day.cq.dam.commons.handler.AbstractAssetHandler
-
- com.day.cq.dam.commons.handler.StandardImageHandler
-
- All Implemented Interfaces:
AssetHandler
@Service public class StandardImageHandler extends AbstractAssetHandler
TheStandardImageHandler
supports currently following image types:- gif
- png
- photoshop
- jpeg
- tiff
- bmp
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BMP1_MIMETYPE
static java.lang.String
BMP2_MIMETYPE
static java.lang.String
CONFIG_LARGE_COMMENT_THRESHOLD
static java.lang.String
CONFIG_LARGE_FILE_THRESHOLD
static java.lang.String
DNG_MIMETYPE
static java.lang.String
GIF_MIMETYPE
Mime typestatic java.lang.String
JPEG_MIMETYPE
static java.lang.String
METADATA_IGNORE_LIST
static java.lang.String
PJPEG_MIMETYPE
static java.lang.String
PNG1_MIMETYPE
static java.lang.String
PNG2_MIMETYPE
static java.lang.String
RAW1_MIMETYPE
static java.lang.String
RAW10_MIMETYPE
static java.lang.String
RAW11_MIMETYPE
static java.lang.String
RAW12_MIMETYPE
static java.lang.String
RAW13_MIMETYPE
static java.lang.String
RAW14_MIMETYPE
static java.lang.String
RAW15_MIMETYPE
static java.lang.String
RAW16_MIMETYPE
static java.lang.String
RAW17_MIMETYPE
static java.lang.String
RAW18_MIMETYPE
static java.lang.String
RAW19_MIMETYPE
static java.lang.String
RAW2_MIMETYPE
static java.lang.String
RAW20_MIMETYPE
static java.lang.String
RAW21_MIMETYPE
static java.lang.String
RAW22_MIMETYPE
static java.lang.String
RAW23_MIMETYPE
static java.lang.String
RAW3_MIMETYPE
static java.lang.String
RAW4_MIMETYPE
static java.lang.String
RAW5_MIMETYPE
static java.lang.String
RAW6_MIMETYPE
static java.lang.String
RAW7_MIMETYPE
static java.lang.String
RAW8_MIMETYPE
static java.lang.String
RAW9_MIMETYPE
static java.lang.String
TIFF_MIMETYPE
static java.lang.String
TIFF1_MIMETYPE
-
Fields inherited from class com.day.cq.dam.commons.handler.AbstractAssetHandler
PROPERTY_DEACTIVATED_MIME_TYPES
-
-
Constructor Summary
Constructors Constructor Description StandardImageHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExtractedMetadata
extractMetadata(Asset asset)
This method is used by theExtractMetadataProcess
as part of the DAM Update Asset workflow during import or update of an asset.java.awt.image.BufferedImage
getImage(Rendition rendition)
java.awt.image.BufferedImage
getImage(Rendition rendition, java.awt.Dimension maxDimension)
java.lang.String[]
getMimeTypes()
This method returns the mime types a particularAssetHandler
supports.-
Methods inherited from class com.day.cq.dam.commons.handler.AbstractAssetHandler
canHandleSubAssets, createThumbnails, createThumbnails, createThumbnails, exportAsset, processRelated, processSubAssets
-
-
-
-
Field Detail
-
CONFIG_LARGE_FILE_THRESHOLD
public static final java.lang.String CONFIG_LARGE_FILE_THRESHOLD
- See Also:
- Constant Field Values
-
CONFIG_LARGE_COMMENT_THRESHOLD
public static final java.lang.String CONFIG_LARGE_COMMENT_THRESHOLD
- See Also:
- Constant Field Values
-
METADATA_IGNORE_LIST
public static final java.lang.String METADATA_IGNORE_LIST
- See Also:
- Constant Field Values
-
GIF_MIMETYPE
public static final java.lang.String GIF_MIMETYPE
Mime type- See Also:
- Constant Field Values
-
PNG1_MIMETYPE
public static final java.lang.String PNG1_MIMETYPE
- See Also:
- Constant Field Values
-
PNG2_MIMETYPE
public static final java.lang.String PNG2_MIMETYPE
- See Also:
- Constant Field Values
-
JPEG_MIMETYPE
public static final java.lang.String JPEG_MIMETYPE
- See Also:
- Constant Field Values
-
PJPEG_MIMETYPE
public static final java.lang.String PJPEG_MIMETYPE
- See Also:
- Constant Field Values
-
TIFF_MIMETYPE
public static final java.lang.String TIFF_MIMETYPE
- See Also:
- Constant Field Values
-
TIFF1_MIMETYPE
public static final java.lang.String TIFF1_MIMETYPE
- See Also:
- Constant Field Values
-
BMP1_MIMETYPE
public static final java.lang.String BMP1_MIMETYPE
- See Also:
- Constant Field Values
-
BMP2_MIMETYPE
public static final java.lang.String BMP2_MIMETYPE
- See Also:
- Constant Field Values
-
RAW1_MIMETYPE
public static final java.lang.String RAW1_MIMETYPE
- See Also:
- Constant Field Values
-
RAW2_MIMETYPE
public static final java.lang.String RAW2_MIMETYPE
- See Also:
- Constant Field Values
-
RAW3_MIMETYPE
public static final java.lang.String RAW3_MIMETYPE
- See Also:
- Constant Field Values
-
RAW4_MIMETYPE
public static final java.lang.String RAW4_MIMETYPE
- See Also:
- Constant Field Values
-
RAW5_MIMETYPE
public static final java.lang.String RAW5_MIMETYPE
- See Also:
- Constant Field Values
-
RAW6_MIMETYPE
public static final java.lang.String RAW6_MIMETYPE
- See Also:
- Constant Field Values
-
RAW7_MIMETYPE
public static final java.lang.String RAW7_MIMETYPE
- See Also:
- Constant Field Values
-
RAW8_MIMETYPE
public static final java.lang.String RAW8_MIMETYPE
- See Also:
- Constant Field Values
-
RAW9_MIMETYPE
public static final java.lang.String RAW9_MIMETYPE
- See Also:
- Constant Field Values
-
RAW10_MIMETYPE
public static final java.lang.String RAW10_MIMETYPE
- See Also:
- Constant Field Values
-
RAW11_MIMETYPE
public static final java.lang.String RAW11_MIMETYPE
- See Also:
- Constant Field Values
-
RAW12_MIMETYPE
public static final java.lang.String RAW12_MIMETYPE
- See Also:
- Constant Field Values
-
RAW13_MIMETYPE
public static final java.lang.String RAW13_MIMETYPE
- See Also:
- Constant Field Values
-
RAW14_MIMETYPE
public static final java.lang.String RAW14_MIMETYPE
- See Also:
- Constant Field Values
-
RAW15_MIMETYPE
public static final java.lang.String RAW15_MIMETYPE
- See Also:
- Constant Field Values
-
RAW16_MIMETYPE
public static final java.lang.String RAW16_MIMETYPE
- See Also:
- Constant Field Values
-
RAW17_MIMETYPE
public static final java.lang.String RAW17_MIMETYPE
- See Also:
- Constant Field Values
-
RAW18_MIMETYPE
public static final java.lang.String RAW18_MIMETYPE
- See Also:
- Constant Field Values
-
RAW19_MIMETYPE
public static final java.lang.String RAW19_MIMETYPE
- See Also:
- Constant Field Values
-
RAW20_MIMETYPE
public static final java.lang.String RAW20_MIMETYPE
- See Also:
- Constant Field Values
-
RAW21_MIMETYPE
public static final java.lang.String RAW21_MIMETYPE
- See Also:
- Constant Field Values
-
RAW22_MIMETYPE
public static final java.lang.String RAW22_MIMETYPE
- See Also:
- Constant Field Values
-
RAW23_MIMETYPE
public static final java.lang.String RAW23_MIMETYPE
- See Also:
- Constant Field Values
-
DNG_MIMETYPE
public static final java.lang.String DNG_MIMETYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getMimeTypes
public java.lang.String[] getMimeTypes()
Description copied from interface:AssetHandler
This method returns the mime types a particularAssetHandler
supports.- Returns:
- mime type, e.g. image/jpg
- See Also:
AssetHandler.getMimeTypes()
-
extractMetadata
public ExtractedMetadata extractMetadata(Asset asset)
Description copied from interface:AssetHandler
This method is used by theExtractMetadataProcess
as part of the DAM Update Asset workflow during import or update of an asset. Implementations must return anExtractedMetadata
object, which may be empty if no metadata is extracted, or contains the metadata values extracted from the binary being imported/updated at the time. TheExtractMetadataProcess
will later save the metadata contained inExtractedMetadata
to the asset's metadata node (e.g. /content/dam/geometrixx/banners/banner-mono.png/jcr:content/metadata). Implementations are free to decide which and how many metadata values are extracted.The method argument represents the
Node
of type nt:file holding the binary content or the DAM Asset node (type dam:Asset), for which its original rendition would be retrieved.- Parameters:
asset
- TheAsset
, from whose original binary metadata will extracted.- Returns:
- The extracted metadata.
-
getImage
public java.awt.image.BufferedImage getImage(Rendition rendition) throws java.io.IOException
This method retrieves the graphical representation of anAsset
s givenRendition
. For images theBufferedImage
of the original image is returned, for other formats the first page is retrieved asBufferedImage
- Specified by:
getImage
in interfaceAssetHandler
- Overrides:
getImage
in classAbstractAssetHandler
- Parameters:
rendition
- The rendition for which to retrieve its graphical representation.- Returns:
BufferedImage
if a graphical representation exists, otherwisenull
- Throws:
java.io.IOException
- in case an error is thrown while fetching the buffered image
-
getImage
public java.awt.image.BufferedImage getImage(Rendition rendition, java.awt.Dimension maxDimension) throws java.io.IOException
This method retrieves the graphical representation of anAsset
s givenRendition
. For images theBufferedImage
of the original image is returned, for other formats the first page is retrieved asBufferedImage
.If
maxDimension
is given, the handler should return an image where no dimension extends the given value. This can be used to reduce the memory footprint of large buffered images if the full resolution is not needed.- Specified by:
getImage
in interfaceAssetHandler
- Overrides:
getImage
in classAbstractAssetHandler
- Parameters:
rendition
- The rendition for which to retrieve its graphical representation.maxDimension
- optional constraint for the maximal dimension of the image.- Returns:
BufferedImage
if a graphical representation exists, otherwisenull
- Throws:
java.io.IOException
- in case an error is thrown while fetching the buffered image
-
-