Metadata Extractor Logo

com.drew.metadata.exif
Class ExifReader

java.lang.Object
  extended by com.drew.metadata.exif.ExifReader
All Implemented Interfaces:
MetadataReader

public class ExifReader
extends java.lang.Object
implements MetadataReader

Decodes Exif binary data, populating a Metadata object with tag values in ExifDirectory, GpsDirectory and one of the many camera makernote directories.

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(byte[] data)
          Creates an ExifReader for the given Exif data segment.
ExifReader(java.io.File jpegFile)
          Deprecated. Not all files will be Jpegs! Use a constructor that provides the exif segment in isolation.
ExifReader(java.io.InputStream jpegInputStream)
          Deprecated. Not all files will be Jpegs! Use a constructor that provides the exif segment in isolation.
ExifReader(JpegSegmentData segmentData)
          Deprecated. Not all files will be Jpegs! This overload doesn't offer much convenience to the caller.
 
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.
 Metadata extractTiff(Metadata metadata)
          Performs the Exif data extraction on a Tiff/Raw, adding found values to the specified instance of Metadata.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAG_EXIF_OFFSET

public static final int TAG_EXIF_OFFSET
See Also:
Constant Field Values

TAG_INTEROP_OFFSET

public static final int TAG_INTEROP_OFFSET
See Also:
Constant Field Values

TAG_GPS_INFO_OFFSET

public static final int TAG_GPS_INFO_OFFSET
See Also:
Constant Field Values

TAG_MAKER_NOTE

public static final int TAG_MAKER_NOTE
See Also:
Constant Field Values

TIFF_HEADER_START_OFFSET

public static final int TIFF_HEADER_START_OFFSET
See Also:
Constant Field Values
Constructor Detail

ExifReader

public ExifReader(JpegSegmentData segmentData)
Deprecated. Not all files will be Jpegs! This overload doesn't offer much convenience to the caller.

Creates an ExifReader for a JpegSegmentData object.

Parameters:
segmentData -

ExifReader

public ExifReader(java.io.File jpegFile)
           throws JpegProcessingException
Deprecated. Not all files will be Jpegs! Use a constructor that provides the exif segment in isolation.

Creates an ExifReader for a Jpeg jpegFile.

Parameters:
jpegFile -
Throws:
JpegProcessingException

ExifReader

public ExifReader(java.io.InputStream jpegInputStream)
           throws JpegProcessingException
Deprecated. Not all files will be Jpegs! Use a constructor that provides the exif segment in isolation.

Creates an ExifReader for a Jpeg stream.

Parameters:
jpegInputStream - JPEG stream. Stream will be closed.
Throws:
JpegProcessingException

ExifReader

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

Method Detail

extract

public Metadata extract()
Performs the Exif data extraction, returning a new instance of Metadata.

Specified by:
extract in interface MetadataReader
Returns:
The populated Metadata object.

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
Returns:
The updated Metadata object.

extractTiff

public Metadata extractTiff(Metadata metadata)
Performs the Exif data extraction on a Tiff/Raw, adding found values to the specified instance of Metadata.


Metadata Extractor Logo

Copyright © 2006 Drew Noakes. All Rights Reserved.