Example usage for android.media ExifInterface getThumbnail

List of usage examples for android.media ExifInterface getThumbnail

Introduction

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

Prototype

public byte[] getThumbnail() 

Source Link

Document

Returns the JPEG compressed thumbnail inside the image file, or null if there is no JPEG compressed thumbnail.

Usage

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

@Kroll.method
public TiBlob getThumbnail(String fileName) {
    try {/*  w  w w  . ja  v  a 2 s. co m*/
        ExifInterface exif = new ExifInterface(fileName);

        byte[] thumbnail = exif.getThumbnail();

        Log.d("TiAPI", "thumbnail's length: " + thumbnail.length);

        return TiBlob.blobFromImage(BitmapFactory.decodeByteArray(thumbnail, 0, thumbnail.length));
    } catch (Exception e) {
        return null;
    }
}