public class ExifHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static TagInfo |
GPS_ALTITUDE
Sanselan doesn't properly define certain tags...
|
static TagInfo |
GPS_ALTITUDE_REF |
static TagInfo |
GPS_DOP |
static TagInfo |
GPS_IMG_DIRECTION |
static TagInfo |
GPS_IMG_DIRECTION_REF |
static TagInfo |
GPS_SOURCE |
static TagInfo |
GPS_SPEED |
static TagInfo |
GPS_TRACK |
static java.lang.String |
TAG |
static TagInfo |
USER_COMMENT |
Constructor and Description |
---|
ExifHelper() |
Modifier and Type | Method and Description |
---|---|
static GeoPoint |
fixImage(MapView _mapView,
java.lang.String path)
Use EXIF location, otherwise use self location, default to last known location...
|
static double |
getAltitude(TiffImageMetadata exif,
double defaultValue)
Get the altitude this image was taken at in meters MSL
|
static java.lang.Number[] |
getDMSArray(double tude)
Convert latlng value to DMS number array
|
static double |
getDouble(TiffImageMetadata exif,
TagInfo tag,
double defaultValue) |
static double[] |
getDoubleArray(TiffImageMetadata exif,
TagInfo tag,
double[] defaultValue) |
static TiffImageMetadata |
getExifMetadata(byte[] blob) |
static TiffImageMetadata |
getExifMetadata(java.io.File jpegFile) |
static TiffOutputSet |
getExifOutput(TiffImageMetadata exif) |
static boolean |
getExtra(TiffImageMetadata exif,
java.lang.String key,
boolean defaultValue) |
static float |
getExtra(TiffImageMetadata exif,
java.lang.String key,
float defaultValue) |
static int |
getExtra(TiffImageMetadata exif,
java.lang.String key,
int defaultValue) |
static java.lang.Object |
getExtra(TiffImageMetadata exif,
java.lang.String key,
java.lang.Object defValue)
Get a single extra parameter
|
static float |
getExtraFloat(TiffImageMetadata exif,
java.lang.String key,
float defaultValue) |
static void |
getExtras(TiffImageMetadata exif,
java.util.Map<java.lang.String,java.lang.Object> bundle)
Convert JSON string in UserComment to a Map (GeoTakCam images only)
Fields include:
- ImgPitch (float)
- ImgRoll (float)
- Inclination (float)
- HorizontalFOV (float)
- VerticalFOV (float)
- Address (string)
|
static java.lang.String |
getExtraString(TiffImageMetadata exif,
java.lang.String key,
java.lang.String defaultValue) |
static TiffOutputDirectory |
getFieldDirectory(TiffOutputSet tos,
TagInfo tag)
Get the output directory for a given metadata tag
|
static int |
getImageOrientation(java.io.File img)
Returns the image orientation as an integer
|
static int |
getInt(TiffImageMetadata exif,
TagInfo tag,
int defaultValue) |
static double[] |
getLatLon(TiffImageMetadata exif) |
static GeoPoint |
getLocation(TiffImageMetadata exif)
Get the GPS location this image was taken it (if available)
|
static java.lang.String |
getString(TiffImageMetadata exif,
TagInfo tag,
java.lang.String defaultValue) |
static long |
getTimeStamp(TiffImageMetadata exif,
long defaultValue)
Get the EXIF GPS time stamp
|
static void |
putExtras(java.util.Map<java.lang.String,java.lang.Object> bundle,
TiffOutputSet tos)
Put the extras bundle back into the TIFF output set
|
static boolean |
saveExifOutput(TiffOutputSet tos,
java.io.File imageFile) |
static void |
setPNGDescription(java.io.File f,
java.lang.String desc)
Set PNG description directly by adding/modifying the tEXt chunk
|
static boolean |
setPoint(TiffOutputSet tos,
GeoPoint point)
Set the point and altitude (if valid)
|
static boolean |
updateField(TiffOutputSet set,
TagInfo tag,
java.lang.Object data) |
public static final java.lang.String TAG
public static final TagInfo GPS_ALTITUDE
public static final TagInfo GPS_ALTITUDE_REF
public static final TagInfo GPS_DOP
public static final TagInfo GPS_SOURCE
public static final TagInfo GPS_SPEED
public static final TagInfo GPS_TRACK
public static final TagInfo GPS_IMG_DIRECTION
public static final TagInfo GPS_IMG_DIRECTION_REF
public static final TagInfo USER_COMMENT
public static java.lang.Number[] getDMSArray(double tude)
tude
- the latitude or longitudepublic static int getImageOrientation(java.io.File img)
img
- the image filepublic static TiffImageMetadata getExifMetadata(java.io.File jpegFile)
public static TiffImageMetadata getExifMetadata(byte[] blob)
public static TiffOutputSet getExifOutput(TiffImageMetadata exif)
public static double getDouble(TiffImageMetadata exif, TagInfo tag, double defaultValue)
public static int getInt(TiffImageMetadata exif, TagInfo tag, int defaultValue)
public static java.lang.String getString(TiffImageMetadata exif, TagInfo tag, java.lang.String defaultValue)
public static long getTimeStamp(TiffImageMetadata exif, long defaultValue)
exif
- Exif metadatadefaultValue
- Default timestamp returnpublic static double[] getDoubleArray(TiffImageMetadata exif, TagInfo tag, double[] defaultValue)
public static double[] getLatLon(TiffImageMetadata exif)
public static GeoPoint getLocation(TiffImageMetadata exif)
exif
- Exif metadatapublic static double getAltitude(TiffImageMetadata exif, double defaultValue)
exif
- Exif metadatadefaultValue
- Default elevation (meters MSL)public static boolean setPoint(TiffOutputSet tos, GeoPoint point)
tos
- EXIF output setpoint
- Point to setpublic static void getExtras(TiffImageMetadata exif, java.util.Map<java.lang.String,java.lang.Object> bundle)
public static void putExtras(java.util.Map<java.lang.String,java.lang.Object> bundle, TiffOutputSet tos)
bundle
- Extras bundletos
- TIFF output setpublic static java.lang.Object getExtra(TiffImageMetadata exif, java.lang.String key, java.lang.Object defValue)
exif
- Exif metadatakey
- Extra keydefValue
- Extra default valuepublic static int getExtra(TiffImageMetadata exif, java.lang.String key, int defaultValue)
public static float getExtra(TiffImageMetadata exif, java.lang.String key, float defaultValue)
public static boolean getExtra(TiffImageMetadata exif, java.lang.String key, boolean defaultValue)
public static float getExtraFloat(TiffImageMetadata exif, java.lang.String key, float defaultValue)
public static java.lang.String getExtraString(TiffImageMetadata exif, java.lang.String key, java.lang.String defaultValue)
public static boolean updateField(TiffOutputSet set, TagInfo tag, java.lang.Object data)
public static TiffOutputDirectory getFieldDirectory(TiffOutputSet tos, TagInfo tag)
tos
- TIFF output settag
- Metadata tagpublic static boolean saveExifOutput(TiffOutputSet tos, java.io.File imageFile)
public static GeoPoint fixImage(MapView _mapView, java.lang.String path)
public static void setPNGDescription(java.io.File f, java.lang.String desc)
f
- The PNG file to modifydesc
- The image description