Last active
December 19, 2015 23:49
-
-
Save daichan4649/6037309 to your computer and use it in GitHub Desktop.
画像ファイル内の EXIF 情報有無判定 (for Android)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static boolean isExistLocationInfo(String filePath) { | |
if (TextUtils.isEmpty(filePath)) { | |
return false; | |
} | |
try { | |
ExifInterface exifIf = new ExifInterface(filePath); | |
float[] output = new float[2]; | |
exifIf.getLatLong(output); | |
// GPS(0, 0) は取得失敗とみなす | |
if (output[0] == 0 && output[1] == 0) { | |
return false; | |
} | |
} catch (IOException e) { | |
return false; | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment