com.thebuzzmedia.exiftool
Enum ExifTool.Tag

java.lang.Object
  extended by java.lang.Enum<ExifTool.Tag>
      extended by com.thebuzzmedia.exiftool.ExifTool.Tag
All Implemented Interfaces:
Serializable, Comparable<ExifTool.Tag>
Enclosing class:
ExifTool

public static enum ExifTool.Tag
extends Enum<ExifTool.Tag>

Enum used to pre-define a convenient list of tags that can be easily extracted from images using this class with an external install of ExifTool.

Each tag defined also includes a type hint for the parsed value associated with it when the default ExifTool.Format.NUMERIC value format is used.

All replies from ExifTool are parsed as Strings and using the type hint from each ExifTool.Tag can easily be converted to the correct data format by using the provided Tag#parseValue(Tag, String) method.

This class does not make an attempt at converting the value automatically in case the caller decides they would prefer tag values returned in ExifTool.Format.HUMAN_READABLE format and to avoid any compatibility issues with future versions of ExifTool if a tag's return value is changed. This approach to leaving returned tag values as strings until the caller decides they want to parse them is a safer and more robust approach.

The types provided by each tag are merely a hint based on the ExifTool Tag Guide by Phil Harvey; the caller is free to parse or process the returned String values any way they wish.

Tag Support

ExifTool is capable of parsing almost every tag known to man (1000+), but this class makes an attempt at pre-defining a convenient list of the most common tags for use.

This list was determined by looking at the common metadata tag values written to images by popular mobile devices (iPhone, Android) as well as cameras like simple point and shoots as well as DSLRs. As an additional source of input the list of supported/common EXIF formats that Flickr supports was also reviewed to ensure the most common/useful tags were being covered here.

Please email me or file an issue if you think this list is missing a commonly used tag that should be added to it.

Since:
1.1
Author:
Riyad Kalla (software@thebuzzmedia.com)

Enum Constant Summary
APERTURE
           
AUTHOR
           
COLOR_SPACE
           
COMMENT
           
CONTRAST
           
DATE_TIME_ORIGINAL
           
DIGITAL_ZOOM_RATIO
           
EXIF_VERSION
           
EXPOSURE_COMPENSATION
           
EXPOSURE_PROGRAM
           
EXPOSURE_TIME
           
FLASH
           
FOCAL_LENGTH
           
FOCAL_LENGTH_35MM
           
GPS_ALTITUDE
           
GPS_ALTITUDE_REF
           
GPS_BEARING
           
GPS_BEARING_REF
           
GPS_LATITUDE
           
GPS_LATITUDE_REF
           
GPS_LONGITUDE
           
GPS_LONGITUDE_REF
           
GPS_PROCESS_METHOD
           
GPS_SPEED
           
GPS_SPEED_REF
           
GPS_TIMESTAMP
           
IMAGE_HEIGHT
           
IMAGE_WIDTH
           
ISO
           
KEYWORDS
           
LENS_MAKE
           
LENS_MODEL
           
MAKE
           
METERING_MODE
           
MODEL
           
ORIENTATION
           
OWNER_NAME
           
RATING
           
RATING_PERCENT
           
SATURATION
           
SENSING_METHOD
           
SHARPNESS
           
SHUTTER_SPEED
           
SOFTWARE
           
SUBJECT
           
TITLE
           
WHITE_BALANCE
           
X_RESOLUTION
           
Y_RESOLUTION
           
 
Method Summary
static ExifTool.Tag forName(String name)
          Used to get the ExifTool.Tag identified by the given, case-sensitive, tag name.
 String getName()
          Used to get the name of the tag (e.g.
 Class<?> getType()
          Used to get a hint for the native type of this tag's value as specified by Phil Harvey's ExifTool Tag Guide.
static
<T> T
parseValue(ExifTool.Tag tag, String value)
          Convenience method used to convert the given string Tag value (returned from the external ExifTool process) into the type described by the associated ExifTool.Tag.
static ExifTool.Tag valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ExifTool.Tag[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ISO

public static final ExifTool.Tag ISO

APERTURE

public static final ExifTool.Tag APERTURE

WHITE_BALANCE

public static final ExifTool.Tag WHITE_BALANCE

CONTRAST

public static final ExifTool.Tag CONTRAST

SATURATION

public static final ExifTool.Tag SATURATION

SHARPNESS

public static final ExifTool.Tag SHARPNESS

SHUTTER_SPEED

public static final ExifTool.Tag SHUTTER_SPEED

DIGITAL_ZOOM_RATIO

public static final ExifTool.Tag DIGITAL_ZOOM_RATIO

IMAGE_WIDTH

public static final ExifTool.Tag IMAGE_WIDTH

IMAGE_HEIGHT

public static final ExifTool.Tag IMAGE_HEIGHT

X_RESOLUTION

public static final ExifTool.Tag X_RESOLUTION

Y_RESOLUTION

public static final ExifTool.Tag Y_RESOLUTION

FLASH

public static final ExifTool.Tag FLASH

METERING_MODE

public static final ExifTool.Tag METERING_MODE

FOCAL_LENGTH

public static final ExifTool.Tag FOCAL_LENGTH

FOCAL_LENGTH_35MM

public static final ExifTool.Tag FOCAL_LENGTH_35MM

EXPOSURE_TIME

public static final ExifTool.Tag EXPOSURE_TIME

EXPOSURE_COMPENSATION

public static final ExifTool.Tag EXPOSURE_COMPENSATION

EXPOSURE_PROGRAM

public static final ExifTool.Tag EXPOSURE_PROGRAM

ORIENTATION

public static final ExifTool.Tag ORIENTATION

COLOR_SPACE

public static final ExifTool.Tag COLOR_SPACE

SENSING_METHOD

public static final ExifTool.Tag SENSING_METHOD

SOFTWARE

public static final ExifTool.Tag SOFTWARE

MAKE

public static final ExifTool.Tag MAKE

MODEL

public static final ExifTool.Tag MODEL

LENS_MAKE

public static final ExifTool.Tag LENS_MAKE

LENS_MODEL

public static final ExifTool.Tag LENS_MODEL

OWNER_NAME

public static final ExifTool.Tag OWNER_NAME

TITLE

public static final ExifTool.Tag TITLE

AUTHOR

public static final ExifTool.Tag AUTHOR

SUBJECT

public static final ExifTool.Tag SUBJECT

KEYWORDS

public static final ExifTool.Tag KEYWORDS

COMMENT

public static final ExifTool.Tag COMMENT

RATING

public static final ExifTool.Tag RATING

RATING_PERCENT

public static final ExifTool.Tag RATING_PERCENT

DATE_TIME_ORIGINAL

public static final ExifTool.Tag DATE_TIME_ORIGINAL

GPS_LATITUDE

public static final ExifTool.Tag GPS_LATITUDE

GPS_LATITUDE_REF

public static final ExifTool.Tag GPS_LATITUDE_REF

GPS_LONGITUDE

public static final ExifTool.Tag GPS_LONGITUDE

GPS_LONGITUDE_REF

public static final ExifTool.Tag GPS_LONGITUDE_REF

GPS_ALTITUDE

public static final ExifTool.Tag GPS_ALTITUDE

GPS_ALTITUDE_REF

public static final ExifTool.Tag GPS_ALTITUDE_REF

GPS_SPEED

public static final ExifTool.Tag GPS_SPEED

GPS_SPEED_REF

public static final ExifTool.Tag GPS_SPEED_REF

GPS_PROCESS_METHOD

public static final ExifTool.Tag GPS_PROCESS_METHOD

GPS_BEARING

public static final ExifTool.Tag GPS_BEARING

GPS_BEARING_REF

public static final ExifTool.Tag GPS_BEARING_REF

GPS_TIMESTAMP

public static final ExifTool.Tag GPS_TIMESTAMP

EXIF_VERSION

public static final ExifTool.Tag EXIF_VERSION
Method Detail

values

public static ExifTool.Tag[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ExifTool.Tag c : ExifTool.Tag.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ExifTool.Tag valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

forName

public static ExifTool.Tag forName(String name)
Used to get the ExifTool.Tag identified by the given, case-sensitive, tag name.

Parameters:
name - The case-sensitive name of the tag that will be searched for.
Returns:
the ExifTool.Tag identified by the given, case-sensitive, tag name or null if one couldn't be found.

parseValue

public static <T> T parseValue(ExifTool.Tag tag,
                               String value)
                    throws IllegalArgumentException,
                           NumberFormatException
Convenience method used to convert the given string Tag value (returned from the external ExifTool process) into the type described by the associated ExifTool.Tag.

Type Parameters:
T - The type of the returned value.
Parameters:
tag - The ExifTool.Tag whose value this is. The tag's type hint will be queried to determine how to convert this string value.
value - The String representation of the tag's value as parsed from the image.
Returns:
the given string value converted to a native Java type (e.g. Integer, Double, etc.).
Throws:
IllegalArgumentException - if tag is null.
NumberFormatException - if any exception occurs while trying to parse the given value to any of the supported numeric types in Java via calls to the respective parseXXX methods defined on all the numeric wrapper classes (e.g. Integer.parseInt(String) , Double.parseDouble(String) and so on).
ClassCastException - if the type defined by T is incompatible with the type defined by getType() returned by the tag argument passed in. This class performs an implicit/unchecked cast to the type T before returning the parsed result of the type indicated by getType(). If the types do not match, a ClassCastException will be generated by the VM.

getName

public String getName()
Used to get the name of the tag (e.g. "Orientation", "ISO", etc.).

Returns:
the name of the tag (e.g. "Orientation", "ISO", etc.).

getType

public Class<?> getType()
Used to get a hint for the native type of this tag's value as specified by Phil Harvey's ExifTool Tag Guide.

Returns:
a hint for the native type of this tag's value.

Copyright 2011 The Buzz Media, LLC