Skip to content

Instantly share code, notes, and snippets.

@daichan4649
Last active December 19, 2015 23:49
Show Gist options
  • Save daichan4649/6037309 to your computer and use it in GitHub Desktop.
Save daichan4649/6037309 to your computer and use it in GitHub Desktop.
画像ファイル内の EXIF 情報有無判定 (for Android)
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