Search in sources :

Example 1 with MediaDetailsMap

use of org.horaapps.leafpic.data.base.MediaDetailsMap in project LeafPic by HoraApps.

the class Media method getMainDetails.

public MediaDetailsMap<String, String> getMainDetails(Context context) {
    metadata = new MetadataItem(new File(path));
    MediaDetailsMap<String, String> details = new MediaDetailsMap<String, String>();
    details.put(context.getString(R.string.path), path != null ? path : getUri().getEncodedPath());
    details.put(context.getString(R.string.type), getMimeType());
    String tmp;
    if ((tmp = metadata.getResolution()) != null)
        details.put(context.getString(R.string.resolution), tmp);
    details.put(context.getString(R.string.size), StringUtils.humanReadableByteCount(size, true));
    details.put(context.getString(R.string.date), SimpleDateFormat.getDateTimeInstance().format(new Date(getDateModified())));
    details.put(context.getString(R.string.orientation), getOrientation() + "");
    if (metadata.getDateOriginal() != null)
        details.put(context.getString(R.string.date_taken), SimpleDateFormat.getDateTimeInstance().format(metadata.getDateOriginal()));
    if ((tmp = metadata.getCameraInfo()) != null)
        details.put(context.getString(R.string.camera), tmp);
    if ((tmp = metadata.getExifInfo()) != null)
        details.put(context.getString(R.string.exif), tmp);
    GeoLocation location;
    if ((location = metadata.getLocation()) != null)
        details.put(context.getString(R.string.location), location.toDMSString());
    return details;
}
Also used : MediaDetailsMap(org.horaapps.leafpic.data.base.MediaDetailsMap) GeoLocation(com.drew.lang.GeoLocation) File(java.io.File) Date(java.util.Date)

Aggregations

GeoLocation (com.drew.lang.GeoLocation)1 File (java.io.File)1 Date (java.util.Date)1 MediaDetailsMap (org.horaapps.leafpic.data.base.MediaDetailsMap)1