I need to know how to check whether given jpeg image has iptc content in it or not ? This should be done with java.As i am new to this techonology. Could someone help regarding this.
to detect IPTC content in jpeg image
1.2k views Asked by jasper At
2
There are 2 answers
0
On
It simple by using the Metadata Extractor, an open source project for reading meta data - hosted on google code.
Supported directories
- Exif
- IPTC
- XMP
- JFIF / JFXX
- ICC Profiles
- Photoshop
Example
Reading HEADLINE TAG from IPTC Directory. There is an GettingStarted chapter.
File file = new File("input.jpg");
// read meta data from image
Metadata metadata = ImageMetadataReader.readMetadata(file);
// get all existing directories
metadata.getDirectories();
// check whether the iptc directory exists
if (metadata.containsDirectory(IptcDirectory.class))
{
// read headline from iptc directory
IptcDirectory directory = metadata.getDirectory(IptcDirectory.class);
directory.getString(IptcDirectory.TAG_HEADLINE);
}
Camera support
The library also read camera-specific data
- Agfa
- Canon
- Casio
- Epson
- Fujifilm
- Kodak
- Kyocera
- Leica
- Minolta
- Nikon
- Olympus
- Panasonic
- Pentax
- Sanyo
- Sigma/Foveon
- Sony
You can use this library,
http://reader.imagero.com/
supported metadata:
Get IPTC metadata from one image and insert it in other:
http://reader.imagero.com/tutorial.html