Java logo

metadata-extractor logo

metadata extraction in java

home | software | metadata extractor

About this library

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.

Supported metadata

Exif

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.

Iptc

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.

Jpeg 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.

Supported media

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.

Using this library

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.

Sample output and development resources

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.

Future plans

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 .

Applications using this library

The following applications make use of this metadata extraction library.

JAlbum
David Ekholm's excellent gallery creation tool
Wolfram Research (Mathematica)
The ubiquitous math application
OziPhotoTool
An application for matching GPS data from the OziExplorer with digital camera images
blueMarine
An OpenSource photo workflow tool
AnaBuilder
A freeware app for developing relief images (Anaglyph red-blue 3D images)
EXIF-O-Matic
An attractive front end application for this library
JPO - Java Picture Organiser
A platform independent image organisation tool
JCap
Free photo captioning software
PicL
OpenSource picture labeller
Java Home Media Option
A media server for TiVo's Home Media Option
SortImages
Renames DSC image files according to their capture date/times
Exif Reader (ImageJ Plugin)
An Exif reading ImageJ plugin, written by Gali Baler
OrangePics
Online photo gallery

...and many more!

Languages other than Java

Further reading

http://www.ba.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html
Very informative site, containing a lot of info on camera makernote formats
http://www.pima.net/standards/it10/PIMA15740/exif.htm
Official Exif specification (PDF)
http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf
JEITA paper on exchangeable image file format for digital cameras
http://www.sentex.net/~mwandel/jhead/
jhead performs many exif-related functions from the command line
http://www.exif.org/
John Hawkins' Exif site (contributor to the Jpeg gallery)

Announcements

A low-volume Yahoo Group exists for metadata-extractor announcements. Subscribe in order to receive updates of future releases:

NOTE: Members cannot post to this group -- it is not for discussion.

Download

You can download the source and compiled binaries on the releases page. Old versions and a changelog are available there too.

If you've found this library useful and would like to thank the author, you can make a donation to show your appreciation for the many hours spent on this project.

VisaMastercardPayPal CreditCardAmerican Express
SwitchSoloVisa DeltaVisa Electron


Valid XHTML 1.1