magoffin.matt.ma2.image
Interface EmbeddedImageMetadata

All Known Implementing Classes:
SmetaMediaMetadata

public interface EmbeddedImageMetadata

API for metadata that supports an embedded image.

This API can be implemented by MediaMetadata implementations that are able to extract image resources from the metadata of certain file types. For example, many MP3 files embed the album cover image as a JPEG or PNG image inside an ID3v2 tag of the MP3 file. A MediaMetadata implementation could support finding and extracting that image so it can be used as the icon for that media item within Matte.

Version:
$Revision: 43 $ $Date: 2007-10-21 11:10:01 +1300 (Sun, 21 Oct 2007) $
Author:
Matt Magoffin (spamsqr@msqr.us)

Method Summary
 java.awt.image.BufferedImage getEmbeddedImage()
          Get a BufferedImage for the embedded image.
 int getEmbeddedImageHeight()
          Get the height, in pixels, of the embedded image.
 java.lang.String getEmbeddedImageMimeType()
          Get the MIME type of the embedded image.
 org.springframework.core.io.Resource getEmbeddedImageResource()
          Get the embedded image as a Resource (original image data).
 int getEmbeddedImageWidth()
          Get the width, in pixels, of the embedded image.
 boolean hasEmbeddedImage()
          Return true if an embedded image is available.
 

Method Detail

hasEmbeddedImage

boolean hasEmbeddedImage()
Return true if an embedded image is available.

Returns:
boolean

getEmbeddedImage

java.awt.image.BufferedImage getEmbeddedImage()
Get a BufferedImage for the embedded image.

If hasEmbeddedImage() returns true, this method will extract the image data and return it as a BufferedImage.

Returns:
BufferedImage

getEmbeddedImageResource

org.springframework.core.io.Resource getEmbeddedImageResource()
Get the embedded image as a Resource (original image data).

If hasEmbeddedImage() returns true, this method will extract the image data and return it as-is, without any alteration, so it can be returned directly as the original image data.

Returns:
Resource for the original embedded image data

getEmbeddedImageMimeType

java.lang.String getEmbeddedImageMimeType()
Get the MIME type of the embedded image.

Returns:
MIME type

getEmbeddedImageWidth

int getEmbeddedImageWidth()
Get the width, in pixels, of the embedded image.

Returns:
width

getEmbeddedImageHeight

int getEmbeddedImageHeight()
Get the height, in pixels, of the embedded image.

Returns:
height