Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.modeshape.sequencer.image
Class ImageMetadataSequencer

    java.lang.Object
      org.modeshape.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.

Constructor Summary
`ImageMetadataSequencer()`

Method Summary
`void` | `sequence(InputStream stream, SequencerOutput output, StreamSequencerContext context)` Sequence the data found in the supplied stream, placing the output information into the supplied map.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ImageMetadataSequencer

    public ImageMetadataSequencer()

Method Detail

### 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.

  ModeShape'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)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008-2011 JBoss, a division of Red Hat. All Rights Reserved.