Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>For reading metadata I think you should have a look on "<a href="http://code.google.com/p/metadata-extractor/" rel="nofollow">metadata-extractor</a>" - an Open Source Project (Apache 2.0 licence) that develops a Java library for reading metadata from image files.</p> <p>At the moment, this project can get access to the following metadata of images:</p> <ul> <li>Exif</li> <li>IPTC</li> <li>XMP</li> <li>JFIF / JFXX</li> <li>ICC Profiles</li> <li>Photoshop fields</li> </ul> <p>The "<a href="http://code.google.com/p/metadata-extractor/" rel="nofollow">metadata-extractor</a>" is hosted at <a href="http://code.google.com/" rel="nofollow">google code</a>.</p> <p>Here is a little straightforward code-example for the 2.4.0 version:</p> <pre><code>public void example() throws Exception { File jpegFile = new File("yourJpgFile.jpg"); Metadata metadata = ImageMetadataReader.readMetadata(jpegFile); Iterator directory = metadata.getDirectoryIterator(); while (directory.hasNext()) { Object tag = directory.next(); if (tag instanceof ExifDirectory) { Iterator tags = ((ExifDirectory) tag).getTagIterator(); while (tags.hasNext()) { System.out.println("EXIF: "+tags.next().toString()); } } else if (tag instanceof IptcDirectory) { Iterator tags = ((IptcDirectory) tag).getTagIterator(); while (tags.hasNext()) { System.out.println("IPTC: "+tags.next().toString()); } } else if (tag instanceof JpegDirectory) { Iterator tags = ((JpegDirectory) tag).getTagIterator(); while (tags.hasNext()) { System.out.println("JPEG: "+tags.next().toString()); } } else { System.err.println(tag.getClass()); } } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload