package epson.print.Util;

import android.media.ExifInterface;

import java.io.IOException;

public class ImageFileUtil {
    public static int getExifRotationDegree(String str) {
        try {
            int attributeInt = new ExifInterface(str).getAttributeInt(android.media.ExifInterface.TAG_ORIENTATION, 0);
            if (attributeInt == 3) {
                return 2;
            }
            if (attributeInt == 6) {
                return 1;
            }
            if (attributeInt != 8) {
                return 0;
            }
            return 3;
        } catch (IOException unused) {
            return -1;
        }
    }
}
