Class JpegImageMetadata
- java.lang.Object
-
- org.apache.commons.imaging.formats.jpeg.JpegImageMetadata
-
- All Implemented Interfaces:
ImageMetadata
public class JpegImageMetadata extends java.lang.Object implements ImageMetadata
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.commons.imaging.common.ImageMetadata
ImageMetadata.ImageMetadataItem
-
-
Field Summary
Fields Modifier and Type Field Description private TiffImageMetadata
exif
private static java.lang.String
NEWLINE
private JpegPhotoshopMetadata
photoshop
-
Constructor Summary
Constructors Constructor Description JpegImageMetadata(JpegPhotoshopMetadata photoshop, TiffImageMetadata exif)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dump()
TiffField
findEXIFValue(TagInfo tagInfo)
TiffField
findEXIFValueWithExactMatch(TagInfo tagInfo)
TiffImageMetadata
getExif()
java.awt.image.BufferedImage
getEXIFThumbnail()
Get the thumbnail image if available.byte[]
getEXIFThumbnailData()
Returns the data of the first JPEG thumbnail found in the EXIF metadata.java.awt.Dimension
getEXIFThumbnailSize()
Returns the size of the first JPEG thumbnail found in the EXIF metadata.java.util.List<ImageMetadata.ImageMetadataItem>
getItems()
JpegPhotoshopMetadata
getPhotoshop()
TiffImageData
getRawImageData()
java.lang.String
toString()
java.lang.String
toString(java.lang.String prefix)
-
-
-
Field Detail
-
photoshop
private final JpegPhotoshopMetadata photoshop
-
exif
private final TiffImageMetadata exif
-
NEWLINE
private static final java.lang.String NEWLINE
-
-
Constructor Detail
-
JpegImageMetadata
public JpegImageMetadata(JpegPhotoshopMetadata photoshop, TiffImageMetadata exif)
-
-
Method Detail
-
getExif
public TiffImageMetadata getExif()
-
getPhotoshop
public JpegPhotoshopMetadata getPhotoshop()
-
getEXIFThumbnailSize
public java.awt.Dimension getEXIFThumbnailSize() throws ImageReadException, java.io.IOException
Returns the size of the first JPEG thumbnail found in the EXIF metadata.- Returns:
- Thumbnail width and height or null if no thumbnail.
- Throws:
ImageReadException
- if it fails to read the imagejava.io.IOException
- if it fails to read the image size
-
getEXIFThumbnailData
public byte[] getEXIFThumbnailData() throws ImageReadException, java.io.IOException
Returns the data of the first JPEG thumbnail found in the EXIF metadata.- Returns:
- JPEG data or null if no thumbnail.
- Throws:
ImageReadException
- if it fails to read the imagejava.io.IOException
- if an IO error occurred
-
getEXIFThumbnail
public java.awt.image.BufferedImage getEXIFThumbnail() throws ImageReadException, java.io.IOException
Get the thumbnail image if available.- Returns:
- the thumbnail image. May be
null
if no image could be found. - Throws:
ImageReadException
- if it fails to read the imagejava.io.IOException
- if it fails to get the thumbnail or to read the image data
-
getRawImageData
public TiffImageData getRawImageData()
-
getItems
public java.util.List<ImageMetadata.ImageMetadataItem> getItems()
- Specified by:
getItems
in interfaceImageMetadata
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toString
public java.lang.String toString(java.lang.String prefix)
- Specified by:
toString
in interfaceImageMetadata
-
dump
public void dump()
-
-