com.drew.metadata.exif

Class ExifReader

Implemented Interfaces:
MetadataReader

public class ExifReader
extends java.lang.Object
implements MetadataReader

Extracts Exif data from a JPEG header segment, providing information about the camera/scanner/capture device (if available). Information is encapsulated in an Metadata object.
Author:
Drew Noakes http://drewnoakes.com

Field Summary

static int
TAG_EXIF_OFFSET
static int
TAG_GPS_INFO_OFFSET
static int
TAG_INTEROP_OFFSET
static int
TAG_MAKER_NOTE
static int
TIFF_HEADER_START_OFFSET

Constructor Summary

ExifReader(File file)
Creates an ExifReader for a Jpeg file.
ExifReader(InputStream is)
Creates an ExifReader for a Jpeg stream.
ExifReader(byte[] data)
Creates an ExifReader for the given JPEG header segment.
ExifReader(JpegSegmentData segmentData)
Creates an ExifReader for a JpegSegmentData object.

Method Summary

Metadata
extract()
Performs the Exif data extraction, returning a new instance of Metadata.
Metadata
extract(Metadata metadata)
Performs the Exif data extraction, adding found values to the specified instance of Metadata.

Field Details

TAG_EXIF_OFFSET

public static final int TAG_EXIF_OFFSET
Field Value:
34665

TAG_GPS_INFO_OFFSET

public static final int TAG_GPS_INFO_OFFSET
Field Value:
34853

TAG_INTEROP_OFFSET

public static final int TAG_INTEROP_OFFSET
Field Value:
40965

TAG_MAKER_NOTE

public static final int TAG_MAKER_NOTE
Field Value:
37500

TIFF_HEADER_START_OFFSET

public static final int TIFF_HEADER_START_OFFSET
Field Value:
6

Constructor Details

ExifReader

public ExifReader(File file)
            throws JpegProcessingException
Creates an ExifReader for a Jpeg file.
Parameters:
file -

ExifReader

public ExifReader(InputStream is)
            throws JpegProcessingException
Creates an ExifReader for a Jpeg stream.
Parameters:
is - JPEG stream. Stream will be closed.

ExifReader

public ExifReader(byte[] data)
Creates an ExifReader for the given JPEG header segment.

ExifReader

public ExifReader(JpegSegmentData segmentData)
Creates an ExifReader for a JpegSegmentData object.
Parameters:
segmentData -

Method Details

extract

public Metadata extract()
Performs the Exif data extraction, returning a new instance of Metadata.
Specified by:
extract in interface MetadataReader

extract

public Metadata extract(Metadata metadata)
Performs the Exif data extraction, adding found values to the specified instance of Metadata.
Specified by:
extract in interface MetadataReader

Copyright © 2006 Drew Noakes. All Rights Reserved.