Package gov.nih.mipav.model.file
Class MetadataExtractor.TagDescriptor<T extends MetadataExtractor.Directory>
- java.lang.Object
-
- gov.nih.mipav.model.file.MetadataExtractor.TagDescriptor<T>
-
- Direct Known Subclasses:
MetadataExtractor.AdobeJpegDescriptor
,MetadataExtractor.AppleMakernoteDescriptor
,MetadataExtractor.AppleRunTimeMakernoteDescriptor
,MetadataExtractor.BmpHeaderDescriptor
,MetadataExtractor.CanonMakernoteDescriptor
,MetadataExtractor.CasioType1MakernoteDescriptor
,MetadataExtractor.CasioType2MakernoteDescriptor
,MetadataExtractor.ExifDescriptorBase
,MetadataExtractor.FileSystemDescriptor
,MetadataExtractor.FujifilmMakernoteDescriptor
,MetadataExtractor.GifAnimationDescriptor
,MetadataExtractor.GifCommentDescriptor
,MetadataExtractor.GifControlDescriptor
,MetadataExtractor.GifHeaderDescriptor
,MetadataExtractor.GifImageDescriptor
,MetadataExtractor.GpsDescriptor
,MetadataExtractor.HuffmanTablesDescriptor
,MetadataExtractor.IccDescriptor
,MetadataExtractor.IptcDescriptor
,MetadataExtractor.JfifDescriptor
,MetadataExtractor.JfxxDescriptor
,MetadataExtractor.JpegCommentDescriptor
,MetadataExtractor.JpegDescriptor
,MetadataExtractor.KodakMakernoteDescriptor
,MetadataExtractor.KyoceraMakernoteDescriptor
,MetadataExtractor.LeicaMakernoteDescriptor
,MetadataExtractor.LeicaType5MakernoteDescriptor
,MetadataExtractor.NikonType1MakernoteDescriptor
,MetadataExtractor.NikonType2MakernoteDescriptor
,MetadataExtractor.OlympusCameraSettingsMakernoteDescriptor
,MetadataExtractor.OlympusEquipmentMakernoteDescriptor
,MetadataExtractor.OlympusFocusInfoMakernoteDescriptor
,MetadataExtractor.OlympusImageProcessingMakernoteDescriptor
,MetadataExtractor.OlympusMakernoteDescriptor
,MetadataExtractor.OlympusRawDevelopment2MakernoteDescriptor
,MetadataExtractor.OlympusRawDevelopmentMakernoteDescriptor
,MetadataExtractor.OlympusRawInfoMakernoteDescriptor
,MetadataExtractor.PanasonicMakernoteDescriptor
,MetadataExtractor.PanasonicRawDistortionDescriptor
,MetadataExtractor.PanasonicRawIFD0Descriptor
,MetadataExtractor.PanasonicRawWbInfo2Descriptor
,MetadataExtractor.PanasonicRawWbInfoDescriptor
,MetadataExtractor.PentaxMakernoteDescriptor
,MetadataExtractor.PhotoshopDescriptor
,MetadataExtractor.PngDescriptor
,MetadataExtractor.PrintIMDescriptor
,MetadataExtractor.PsdHeaderDescriptor
,MetadataExtractor.ReconyxHyperFire2MakernoteDescriptor
,MetadataExtractor.ReconyxHyperFireMakernoteDescriptor
,MetadataExtractor.ReconyxUltraFireMakernoteDescriptor
,MetadataExtractor.RicohMakernoteDescriptor
,MetadataExtractor.SamsungType2MakernoteDescriptor
,MetadataExtractor.SanyoMakernoteDescriptor
,MetadataExtractor.SigmaMakernoteDescriptor
,MetadataExtractor.SonyTag9050bDescriptor
,MetadataExtractor.SonyType1MakernoteDescriptor
,MetadataExtractor.SonyType6MakernoteDescriptor
- Enclosing class:
- MetadataExtractor
public class MetadataExtractor.TagDescriptor<T extends MetadataExtractor.Directory> extends java.lang.Object
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 https://drewnoakes.com
-
-
Field Summary
Fields Modifier and Type Field Description protected T
_directory
-
Constructor Summary
Constructors Constructor Description TagDescriptor(T directory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.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.protected java.lang.String
get7BitStringFromBytes(int tagType)
protected java.lang.String
getBitFlagDescription(int tagType, java.lang.Object... labels)
LSB first.protected java.lang.String
getByteLengthDescription(int tagType)
protected java.lang.String
getDecimalRational(int tagType, int decimalPlaces)
java.lang.String
getDescription(int tagType)
Returns a descriptive value of the specified tag for this image.protected java.lang.String
getEncodedTextDescription(int tagType)
protected java.lang.String
getEpochTimeDescription(int tagType)
protected java.lang.String
getFocalLengthDescription(double mm)
protected java.lang.String
getFormattedFloat(int tagType, java.lang.String format)
protected java.lang.String
getFormattedInt(int tagType, java.lang.String format)
protected java.lang.String
getFormattedString(int tagType, java.lang.String format)
protected java.lang.String
getFStopDescription(double fStop)
protected java.lang.String
getIndexedDescription(int tagType, int baseIndex, java.lang.String... descriptions)
protected java.lang.String
getIndexedDescription(int tagType, java.lang.String... descriptions)
protected java.lang.String
getLensSpecificationDescription(int tag)
protected java.lang.String
getOrientationDescription(int tag)
protected java.lang.String
getRationalOrDoubleString(int tagType)
protected java.lang.String
getShutterSpeedDescription(int tag)
protected java.lang.String
getSimpleRational(int tagType)
protected java.lang.String
getStringFromBytes(int tag, java.nio.charset.Charset cs)
protected java.lang.String
getVersionBytesDescription(int tagType, int majorDigits)
-
-
-
Field Detail
-
_directory
protected final T extends MetadataExtractor.Directory _directory
-
-
Constructor Detail
-
TagDescriptor
public TagDescriptor(T directory)
-
-
Method Detail
-
getDescription
public java.lang.String getDescription(int tagType)
Returns a descriptive value of 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 bygetString(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 java.lang.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
-
getVersionBytesDescription
protected java.lang.String getVersionBytesDescription(int tagType, int majorDigits)
-
getIndexedDescription
protected java.lang.String getIndexedDescription(int tagType, java.lang.String... descriptions)
-
getIndexedDescription
protected java.lang.String getIndexedDescription(int tagType, int baseIndex, java.lang.String... descriptions)
-
getByteLengthDescription
protected java.lang.String getByteLengthDescription(int tagType)
-
getSimpleRational
protected java.lang.String getSimpleRational(int tagType)
-
getDecimalRational
protected java.lang.String getDecimalRational(int tagType, int decimalPlaces)
-
getFormattedInt
protected java.lang.String getFormattedInt(int tagType, java.lang.String format)
-
getFormattedFloat
protected java.lang.String getFormattedFloat(int tagType, java.lang.String format)
-
getFormattedString
protected java.lang.String getFormattedString(int tagType, java.lang.String format)
-
getEpochTimeDescription
protected java.lang.String getEpochTimeDescription(int tagType)
-
getBitFlagDescription
protected java.lang.String getBitFlagDescription(int tagType, java.lang.Object... labels)
LSB first. Labels may be null, a String, or a String[2] with (low label,high label) values.
-
get7BitStringFromBytes
protected java.lang.String get7BitStringFromBytes(int tagType)
-
getStringFromBytes
protected java.lang.String getStringFromBytes(int tag, java.nio.charset.Charset cs)
-
getRationalOrDoubleString
protected java.lang.String getRationalOrDoubleString(int tagType)
-
getFStopDescription
protected java.lang.String getFStopDescription(double fStop)
-
getFocalLengthDescription
protected java.lang.String getFocalLengthDescription(double mm)
-
getLensSpecificationDescription
protected java.lang.String getLensSpecificationDescription(int tag)
-
getOrientationDescription
protected java.lang.String getOrientationDescription(int tag)
-
getShutterSpeedDescription
protected java.lang.String getShutterSpeedDescription(int tag)
-
getEncodedTextDescription
protected java.lang.String getEncodedTextDescription(int tagType)
-
-