メインカメラで撮影された画像のサイズをExifで調べる事はできますか?

97 views
Skip to first unread message

wakingm...@gmail.com

unread,
Mar 2, 2016, 9:52:10 PM3/2/16
to 日本Androidの会
メインカメラというのは、スマホの背面にあるカメラの事です。
メインカメラで撮影された画像限定で調べたいです。

wakingm...@gmail.com

unread,
Mar 2, 2016, 9:53:18 PM3/2/16
to 日本Androidの会
インカメラで撮影された画像のサイズは調べないようにしたいです。

2016年3月3日木曜日 11時52分10秒 UTC+9 wakingm...@gmail.com:
メインカメラというのは、スマホの背面にあるカメラの事です。
メインカメラで撮影された画像限定で調べたいです。

sakita yasushi

unread,
Mar 7, 2016, 11:34:30 PM3/7/16
to android-g...@googlegroups.com
カメラに保存された写真が、JPEGで、その画像ファイルパスがわかればできます。
public static MyExifEntity readExif(String filePath) {
MyExifEntity entity = new MyExifEntity();
try {
ExifInterface exif = new ExifInterface(filePath);

if (exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE) == null
|| exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE).equals(""))
return null;
entity.setFilePath(filePath);
entity.setLatitudeDegree(Gps.convertDmsToDegree(
exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE),
exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE_REF)));
entity.setLongitudeDegree(Gps.convertDmsToDegree(
exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE),
exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF)));
entity.setDatetime(exif.getAttribute(ExifInterface.TAG_DATETIME));
entity.setOrientation(exif.getAttribute(ExifInterface.TAG_ORIENTATION));
} catch (IOException e) {
e.printStackTrace();
}
return entity;
}

2016年3月3日 11:53 <wakingm...@gmail.com>:

--
このメールは Google グループのグループ「日本Androidの会」に登録しているユーザーに送られています。
このグループから退会し、グループからのメールの配信を停止するには android-group-j...@googlegroups.com にメールを送信してください。
このグループに投稿するには android-g...@googlegroups.com にメールを送信してください。
https://groups.google.com/group/android-group-japan からこのグループにアクセスしてください。
その他のオプションについては https://groups.google.com/d/optout にアクセスしてください。

Reply all
Reply to author
Forward
0 new messages