Created
November 10, 2009 13:14
-
-
Save taka2/230881 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import java.io.File; | |
| // metadata extraction in java: http://www.drewnoakes.com/code/exif/ | |
| import com.drew.imaging.jpeg.*; | |
| import com.drew.metadata.*; | |
| import com.drew.metadata.exif.*; | |
| public class JavaTest | |
| { | |
| public static void main(String[] args) throws Exception | |
| { | |
| // ファイルの取得 | |
| File f = new File("IMG_0665.JPG"); | |
| // JPEGメタデータの取得 | |
| Metadata metadata = JpegMetadataReader.readMetadata(f); | |
| // 撮影日を取得して表示 | |
| System.out.println("撮影日(Date/Time Original) = " + metadata.getDirectory(ExifDirectory.class).getString(ExifDirectory.TAG_DATETIME_ORIGINAL)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment