org.jempbox.xmp

Class Thumbnail


public class Thumbnail
extends java.lang.Object

This class represents a thumbnail datatype.
Version:
$Revision: 1.1 $
Author:
Ben Litchfield (ben@benlitchfield.com)

Field Summary

static String
FORMAT_JPEG
A supported thumnail format.
protected Element
parent
The DOM representation of this object.

Constructor Summary

Thumbnail(Element parentElement)
Create a thumnail based on a parent property set.
Thumbnail(XMPMetadata metadata)
Create a new thumbnail element.

Method Summary

Element
getElement()
Get the underlying XML element.
String
getFormat()
Get the format of the thumbnail.
Integer
getHeight()
Get the height of the image in pixels.
String
getImage()
Get the image data in base 64 encoding.
Integer
getWidth()
Get the width of the image in pixels.
void
setFormat(String format)
Set the format of the thumbnail, currently only JPEG is supported.
void
setHeight(Integer height)
Set the height of the element.
void
setImage(String image)
Set the image data in base 64 encoding.
void
setWidth(Integer width)
Set the width of the element.

Field Details

FORMAT_JPEG

public static final String FORMAT_JPEG
A supported thumnail format.

parent

protected Element parent
The DOM representation of this object.

Constructor Details

Thumbnail

public Thumbnail(Element parentElement)
Create a thumnail based on a parent property set.
Parameters:
parentElement - The parent element that will store the thumbnail properties.

Thumbnail

public Thumbnail(XMPMetadata metadata)
Create a new thumbnail element.
Parameters:
metadata - The metadata document that his thumbnail will be part of.

Method Details

getElement

public Element getElement()
Get the underlying XML element.
Returns:
The XML element that this object represents.

getFormat

public String getFormat()
Get the format of the thumbnail. See FORMAT_XXX constants.
Returns:
The image format.

getHeight

public Integer getHeight()
Get the height of the image in pixels.
Returns:
The height of the image in pixels.

getImage

public String getImage()
Get the image data in base 64 encoding.
Returns:
The image data.

getWidth

public Integer getWidth()
Get the width of the image in pixels.
Returns:
The width of the image in pixels.

setFormat

public void setFormat(String format)
Set the format of the thumbnail, currently only JPEG is supported. See FORMAT_XXX constants.
Parameters:
format - The image format.

setHeight

public void setHeight(Integer height)
Set the height of the element.
Parameters:
height - The updated height of the element.

setImage

public void setImage(String image)
Set the image data in base 64 encoding.
Parameters:
image - The image.

setWidth

public void setWidth(Integer width)
Set the width of the element.
Parameters:
width - The updated width of the element.