Example usage for android.media ExifInterface hasThumbnail

List of usage examples for android.media ExifInterface hasThumbnail

Introduction

In this page you can find the example usage for android.media ExifInterface hasThumbnail.

Prototype

public boolean hasThumbnail() 

Source Link

Document

Returns true if the image file has a thumbnail.

Usage

From source file:com.oxgcp.photoList.PhotolistModule.java

@Kroll.method
public KrollDict getExifData(String fileName) {
    try {//from   w w  w .ja v a 2 s.c  om
        ExifInterface exif = new ExifInterface(fileName);

        HashMap<String, String> tag = new HashMap<String, String>();

        tag.put("hasThumbnail", exif.hasThumbnail() ? "true" : null);
        tag.put("height", exif.getAttribute("ImageLength"));
        tag.put("width", exif.getAttribute("ImageWidth"));
        tag.put("alt", exif.getAttribute("GPSAltitude"));
        tag.put("altRef", exif.getAttribute("GPSAltitudeRef"));
        tag.put("lat", exif.getAttribute("GPSLatitude"));
        tag.put("latRef", exif.getAttribute("GPSLatitudeRef"));
        tag.put("lon", exif.getAttribute("GPSLongitude"));
        tag.put("lonRef", exif.getAttribute("GPSLongitudeRef"));
        tag.put("date", exif.getAttribute("GPSDateStamp"));
        tag.put("time", exif.getAttribute("GPSTimeStamp"));

        return new KrollDict(tag);//new JSONObject(tag).toString();
    } catch (Exception e) {
        return null;
    }
}