#!/bin/perl -w
# xmlpextract.pl $Id$ by Dan Brickley <danbri@w3.org>
# with help from Nadia Heninger
# Perl script that XMP metadata chunks from media files (JPEG, PDF, ...)
#
# XMP spec: http://www.adobe.com/products/xmp/main.html
#   rdfpic: http://jigsaw.w3.org/rdfpic/
#   rdfweb: http://rdfweb.org/2002/01/photo/
# see also: http://www.profium.com/gb/products/extractor

my $c;
open(IN, shift) || die "No image file to scan for XMP packets";
while(<IN>){ $c .= $_; }
close IN;

$c =~ m/id='W5M0MpCehiHzreSzNTczkc9d'\?>(.*)<\?xpacket end='w'\?>/sg;
print $1;
