com.drew.metadata
Class TagDescriptor<T extends Directory>
java.lang.Object
com.drew.metadata.TagDescriptor<T>
- Direct Known Subclasses:
- AdobeJpegDescriptor, CanonMakernoteDescriptor, CasioType1MakernoteDescriptor, CasioType2MakernoteDescriptor, DefaultTagDescriptor, ExifIFD0Descriptor, ExifInteropDescriptor, ExifSubIFDDescriptor, ExifThumbnailDescriptor, FujifilmMakernoteDescriptor, GpsDescriptor, IccDescriptor, IptcDescriptor, JfifDescriptor, JpegCommentDescriptor, JpegDescriptor, KodakMakernoteDescriptor, KyoceraMakernoteDescriptor, NikonType1MakernoteDescriptor, NikonType2MakernoteDescriptor, OlympusMakernoteDescriptor, PanasonicMakernoteDescriptor, PentaxMakernoteDescriptor, PhotoshopDescriptor, PsdHeaderDescriptor, SigmaMakernoteDescriptor, SonyType1MakernoteDescriptor, SonyType6MakernoteDescriptor, XmpDescriptor
public abstract class TagDescriptor<T extends Directory>
- extends Object
Abstract base class for all tag descriptor classes. Implementations are responsible for
providing the human-readable string representation of tag values stored in a directory.
The directory is provided to the tag descriptor via its constructor.
- Author:
- Drew Noakes http://drewnoakes.com
|
Method Summary |
static String |
convertBytesToVersionString(int[] components,
int majorDigits)
Takes a series of 4 bytes from the specified offset, and converts these to a
well-known version number, where possible. |
String |
getDescription(int tagType)
Returns a descriptive value of the the specified tag for this image. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_directory
protected final T extends Directory _directory
TagDescriptor
public TagDescriptor(T directory)
getDescription
public String getDescription(int tagType)
- Returns a descriptive value of the the specified tag for this image.
Where possible, known values will be substituted here in place of the raw
tokens actually kept in the metadata segment. If no substitution is
available, the value provided by
getString(tagType) will be returned.
- Parameters:
tagType - the tag to find a description for
- Returns:
- a description of the image's value for the specified tag, or
null if the tag hasn't been defined.
convertBytesToVersionString
public static String convertBytesToVersionString(int[] components,
int majorDigits)
- Takes a series of 4 bytes from the specified offset, and converts these to a
well-known version number, where possible.
Two different formats are processed:
- [30 32 31 30] -> 2.10
- [0 1 0 0] -> 1.00
- Parameters:
components - the four version valuesmajorDigits - the number of components to be
- Returns:
- the version as a string of form "2.10" or null if the argument cannot be converted
Copyright © 2012. All Rights Reserved.