ExifTool is a Java integration library for Phil Harvey's (perl) ExifTool, providing an easy way to read and write EXIF, IPTC, XMP and other metadata from image files. For example:
ExifTool tool = new ExifTool();
File imageFile = new File("/path/to/image.jpg");
//Read Metadata
Map<ExifTool.Tag,String> metadata = tool.getImageMeta(imageFile,
ExifTool.Format.HUMAN_READABLE, ExifTool.Tag.values());
String cameraModel = metadata.get(ExifTool.Tag.MODEL);
ExifTool.Tag tag = ExifTool.Tag.IMAGE_HEIGHT;
int imageWidth = tag.parseValue(metadata.get(tag));
//Write Metadata
Map<Object, Object> data = new HashMap<Object, Object>();
data.put(ExifTool.MwgTag.KEYWORDS, new String[]{"portrait", "nature", "flower"});
tool.writeMetadata(imageFile, data);
See the included unit tests for more examples.
ExifTool was originally developed by The Buzz Media. This repository is forked from the original project for use with DF Studio.
This library is released under the Apache 2 License. See LICENSE.