
home | software | metadata extractor
What began as a simple utility to extract the date-taken from a digital still camera (DSC) Jpeg file is now a general metadata extraction framework. Support currently exists for Exif and Iptc metadata segments. Extraction of these segments is provided for Jpeg files. It is hoped that individuals with specific needs will extend the framework by adding their own classes.
Information extracted by this library might be of use to you if you're writing an image browser, image categoriser, photo album, etc... I started coding this library for use in my own photo gallery.
This is the only Java based Exif extraction library I know of. I've seen versions in C, Python, PHP and Delphi (see below). This library has also been ported to C#.
This metadata library is available with Java source code for usage in the public domain.
Digital cameras and scanners store information about the camera, and the conditions under which the image was exposed/digitised. This data is stored in EXIF format. In Jpegs, segment APP1 holds Exif data, though Exif is stored in other Image formats too.
The com.drew.metadata.exif package of this framework supports manufacturer
specific metadata (maker notes) for several Nikon, Canon, FujiFilm, Casio, Olympus, Kodak,
Kyocera, Panasonic, Pentax and Sony models.
The International Press and Telecommunications Council (IPTC) makes recommendations for a standardised structure to metadata within electronic media (images/video/audio). Photoshop uses the Iptc structure to store author, caption, comment and other fields in images. In Jpeg files, this data is stored in the APPD segment.
The Jpeg file format allows for a variety of custom metadata segments. Photoshop and other software uses one such segment to store information about the author, etc. in Iptc format. Many digital still cameras and scanners store information in a different segment using Exif format.
Currently, only JPEG media files are supported. However, the framework is generic and well modularised. Supporting additional media types (such as TIFF/PSD/NEF/CRW/MRW/ORF) should be simple in most cases.
You're free to use this code as you see fit. Please send me a short email to let me know if you find it useful. If you make interesting changes, mail me a copy and I'll include the details on this site. The continual contact with users and contributors of the library encourages and motivates me to keep making improvements. The code is protected by copyright, though only to avoid people selling it unmodified or copyrighting it themselves. You are free to sell work based upon this library, though please consider making a donation.
I've posted javadoc. Though it's not very thoroughly annotated, it still gives an easy way to browse the class structure and members.
Here's some sample source code showing the usage of my library.
I've put together a directory of JPEG images from various different camera models to aid further development of the codebase. Please send additions to me via . Large attachments sometimes bounce. Please warn me beforehand. Huge thanks to everyone who's provided images so far.
I've collected some sample output from version 2.0 showing Exif (including Gps) and Iptc tags from the one Jpeg image.
Support for:
As stated previously, it is hoped others will extend the framework. If you've got some code you'd like to integrate, drop me an .
The following applications make use of this metadata extraction library.
...and many more!
A low-volume Yahoo Group exists for metadata-extractor announcements. Subscribe in order to receive updates of future releases:
You can download the source and compiled binaries on the releases page. Old versions and a changelog are available there too.





