org.jboss.dna.sequencer.image
Class ImageMetadataSequencer
java.lang.Object
org.jboss.dna.sequencer.image.ImageMetadataSequencer
- All Implemented Interfaces:
- StreamSequencer
public class ImageMetadataSequencer
- extends Object
- implements StreamSequencer
A sequencer that processes the binary content of an image file, extracts the metadata for the image, and then writes that image
metadata to the repository.
This sequencer produces data that corresponds to the following structure:
- image:metadata node of type
image:metadata
- jcr:mimeType - optional string property for the mime type of the image
- jcr:encoding - optional string property for the encoding of the image
- image:formatName - string property for the name of the format
- image:width - optional integer property for the image's width in pixels
- image:height - optional integer property for the image's height in pixles
- image:bitsPerPixel - optional integer property for the number of bits per pixel
- image:progressive - optional boolean property specifying whether the image is stored in a progressive
(i.e., interlaced) form
- image:numberOfImages - optional integer property for the number of images stored in the file; defaults to
1
- image:physicalWidthDpi - optional integer property for the physical width of the image in dots per inch
- image:physicalHeightDpi - optional integer property for the physical height of the image in dots per inch
- image:physicalWidthInches - optional double property for the physical width of the image in inches
- image:physicalHeightInches - optional double property for the physical height of the image in inches
This structure could be extended in the future to add EXIF and IPTC metadata as child nodes. For example, EXIF metadata is
structured as tags in directories, where the directories form something like namespaces, and which are used by different camera
vendors to store custom metadata. This structure could be mapped with each directory (e.g. "EXIF" or "Nikon Makernote" or
"IPTC") as the name of a child node, with the EXIF tags values stored as either properties or child nodes.
METADATA_NODE
public static final String METADATA_NODE
- See Also:
- Constant Field Values
IMAGE_PRIMARY_TYPE
public static final String IMAGE_PRIMARY_TYPE
- See Also:
- Constant Field Values
IMAGE_MIXINS
public static final String IMAGE_MIXINS
- See Also:
- Constant Field Values
IMAGE_MIME_TYPE
public static final String IMAGE_MIME_TYPE
- See Also:
- Constant Field Values
IMAGE_ENCODING
public static final String IMAGE_ENCODING
- See Also:
- Constant Field Values
IMAGE_FORMAT_NAME
public static final String IMAGE_FORMAT_NAME
- See Also:
- Constant Field Values
IMAGE_WIDTH
public static final String IMAGE_WIDTH
- See Also:
- Constant Field Values
IMAGE_HEIGHT
public static final String IMAGE_HEIGHT
- See Also:
- Constant Field Values
IMAGE_BITS_PER_PIXEL
public static final String IMAGE_BITS_PER_PIXEL
- See Also:
- Constant Field Values
IMAGE_PROGRESSIVE
public static final String IMAGE_PROGRESSIVE
- See Also:
- Constant Field Values
IMAGE_NUMBER_OF_IMAGES
public static final String IMAGE_NUMBER_OF_IMAGES
- See Also:
- Constant Field Values
IMAGE_PHYSICAL_WIDTH_DPI
public static final String IMAGE_PHYSICAL_WIDTH_DPI
- See Also:
- Constant Field Values
IMAGE_PHYSICAL_HEIGHT_DPI
public static final String IMAGE_PHYSICAL_HEIGHT_DPI
- See Also:
- Constant Field Values
IMAGE_PHYSICAL_WIDTH_INCHES
public static final String IMAGE_PHYSICAL_WIDTH_INCHES
- See Also:
- Constant Field Values
IMAGE_PHYSICAL_HEIGHT_INCHES
public static final String IMAGE_PHYSICAL_HEIGHT_INCHES
- See Also:
- Constant Field Values
ImageMetadataSequencer
public ImageMetadataSequencer()
sequence
public void sequence(InputStream stream,
SequencerOutput output,
StreamSequencerContext context)
- Sequence the data found in the supplied stream, placing the output information into the supplied map.
JBoss DNA's SequencingService determines the sequencers that should be executed by monitoring the changes to one or more
workspaces that it is monitoring. Changes in those workspaces are aggregated and used to determine which sequencers should
be called. If the sequencer implements this interface, then this method is called with the property that is to be sequenced
along with the interface used to register the output. The framework takes care of all the rest.
- Specified by:
sequence
in interface StreamSequencer
- Parameters:
stream
- the stream with the data to be sequenced; never null
output
- the output from the sequencing operation; never null
context
- the context for the sequencing operation; never null
- See Also:
StreamSequencer.sequence(InputStream, SequencerOutput, StreamSequencerContext)
Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.