ContentHandler ch = new DefaultHandler();
m = new Metadata();
ParseContext pc = new ParseContext();
jp = new JpegParser();
XMPPacketScanner xps = new XMPPacketScanner();
try {
jp.parse(new BufferedInputStream(new FileInputStream(f)), ch, m, pc);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
xps.parse(new FileInputStream(f), baos);
if (baos.size() > 0){
try {
xmpex = new XMPExtractor(XMPMetaFactory.parseFromBuffer(baos.toByteArray()));
} catch (XMPException e) {
e.printStackTrace();