I have saved Picasa's face data inside my JPEG files (in XMP) and now I am trying to read that information in Java. So far I am failing and help would be much appreciated.
I am trying to use metadata-extractor library (though any other solution would also be fine). I can read the basic information (like the date, the image size etc.), but I am lost at extracting the additional data. This is what I get so far:
File file -- this is my JPEG file
Metadata metadata = JpegMetadataReader.readMetadata(file);
XmpDirectory xmpDirectory = metadata.getDirectory(XmpDirectory.class);
XMPMeta xmpMeta = xmpDirectory.getXMPMeta();
System.out.println(xmpMeta.dumpObject());
Result:
ROOT NODE
http://www.metadataworkinggroup.com/schemas/regions/ = "mwg-rs:" (0x80000000 : SCHEMA_NODE)
mwg-rs:Regions (0x100 : STRUCT)
mwg-rs:AppliedToDimensions (0x100 : STRUCT)
stDim:h = "2793"
stDim:unit = "pixel"
stDim:w = "2047"
mwg-rs:RegionList (0x200 : ARRAY)
[1] (0x100 : STRUCT)
mwg-rs:Area (0x100 : STRUCT)
stArea:h = "0.69531"
stArea:unit = "normalized"
stArea:w = "0.790425"
stArea:x = "0.491451"
stArea:y = "0.41783"
mwg-rs:Name = "abcde"
mwg-rs:Type = "Face"
http://ns.adobe.com/xap/1.0/ = "xmp:" (0x80000000 : SCHEMA_NODE)
xmp:ModifyDate = "2014-04-06T19:43:24+01:00"
I do not understand how to get to these stArea:w, mwg-rs:Type = "Face", etc.