ExifInterface 属性 Right-top

以下是完整的配置写入 

ExifInterface exifInterface = new ExifInterface(picPath);
exifInterface.setAttribute(ExifInterface.TAG_GPS_LATITUDE, gpsInfoConvert(latitude));
                exifInterface.setAttribute(ExifInterface.TAG_GPS_LONGITUDE, gpsInfoConvert(longitude));
                exifInterface.setAttribute(ExifInterface.TAG_GPS_LATITUDE_REF, "N");
                exifInterface.setAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF, "E");
                exifInterface.setAttribute(ExifInterface.TAG_ORIENTATION,"6");//6 Right-top
                exifInterface.saveAttributes();
private static String gpsInfoConvert(double gpsInfo) {
        gpsInfo = Math.abs(gpsInfo);
        String dms = Location.convert(gpsInfo, Location.FORMAT_SECONDS);
        String[] splits = dms.split(":");
        String[] secondAry = (splits[2]).split("\\.");
        String seconds;
        if (secondAry.length == 0) {
            seconds = splits[2];
        } else {
            seconds = secondAry[0];
        }
        return splits[0] + "/1," + splits[1] + "/1," + seconds + "/1";
    }

 

转载

你可能感兴趣的:(android)