use of com.drew.metadata.exif.GpsDescriptor in project java-mapollage by trixon.
the class Operation method getPlacemarkDescription.
private String getPlacemarkDescription(File file, PhotoInfo photoInfo, Date exifDate) throws IOException {
GpsDirectory gpsDirectory = photoInfo.getGpsDirectory();
GpsDescriptor gpsDescriptor = null;
if (gpsDirectory != null) {
gpsDescriptor = new GpsDescriptor(gpsDirectory);
}
String desc = "";
switch(mProfileDescription.getMode()) {
case CUSTOM:
desc = mProfileDescription.getCustomValue();
break;
case EXTERNAL:
desc = getExternalDescription(file);
break;
case NONE:
// Do nothing
break;
case STATIC:
desc = getStaticDescription();
break;
}
if (mProfileDescription.getMode() != ProfileDescription.DescriptionMode.NONE) {
if (StringUtils.containsIgnoreCase(desc, DescriptionSegment.PHOTO.toString())) {
desc = StringUtils.replace(desc, DescriptionSegment.PHOTO.toString(), getDescPhoto(file, photoInfo.getOrientation()));
}
desc = StringUtils.replace(desc, DescriptionSegment.FILENAME.toString(), file.getName());
desc = StringUtils.replace(desc, DescriptionSegment.DATE.toString(), mDateFormatDate.format(exifDate));
if (gpsDirectory != null && gpsDescriptor != null) {
desc = StringUtils.replace(desc, DescriptionSegment.ALTITUDE.toString(), gpsDescriptor.getGpsAltitudeDescription());
desc = StringUtils.replace(desc, DescriptionSegment.COORDINATE.toString(), gpsDescriptor.getDegreesMinutesSecondsDescription());
String bearing = gpsDescriptor.getGpsDirectionDescription(GpsDirectory.TAG_DEST_BEARING);
desc = StringUtils.replace(desc, DescriptionSegment.BEARING.toString(), bearing == null ? "" : bearing);
} else {
desc = StringUtils.replace(desc, DescriptionSegment.ALTITUDE.toString(), "");
desc = StringUtils.replace(desc, DescriptionSegment.COORDINATE.toString(), "");
desc = StringUtils.replace(desc, DescriptionSegment.BEARING.toString(), "");
}
desc = getSafeXmlString(desc);
}
return desc;
}
Aggregations