Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.media.ExifInterface;
import android.net.Uri;

import java.io.IOException;

public class Main {

    public static int getOrientation(final Uri photoUri) {
        ExifInterface exifInterface = null;
        try {
            exifInterface = new ExifInterface(photoUri.toString());
        } catch (IOException e) {
            e.printStackTrace();
        }
        return exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, -1);
    }
}