commit 333683dce2678f8ded9ed3dce87bc411a81f8d79
parent c67614722aeee3096b43eb0398900eeab2bc719e
Author: Dan Callaghan <djc@djc.id.au>
Date: Mon, 9 Aug 2010 22:59:18 +1000
parse XMP packet on loading and spit out some crap (does nothing useful, yet)
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/ImageMetadata.vala b/src/ImageMetadata.vala
@@ -18,7 +18,6 @@ public class PropertyEditor : Object {
public class ImageMetadata : Object {
- private GExiv2.Metadata exiv_metadata;
public string path { get; construct; }
public Gee.List<PropertyEditor> properties { get; construct; }
@@ -30,12 +29,17 @@ public class ImageMetadata : Object {
construct {
properties = new Gee.LinkedList<PropertyEditor>();
- exiv_metadata = new GExiv2.Metadata();
}
// ugh, for exceptions
public void load() throws GLib.Error {
+ var exiv_metadata = new GExiv2.Metadata();
exiv_metadata.open_path(path);
+ string xmp = exiv_metadata.get_xmp_packet();
+ stdout.puts(xmp);
+ var g = new RDF.Graph.from_xml(xmp, File.new_for_path(path).get_uri());
+ foreach (var s in g.get_statements())
+ stdout.puts(@"$s\n");
foreach (var tag in exiv_metadata.get_xmp_tags()) {
properties.add(new PropertyEditor(tag, exiv_metadata.get_xmp_tag_string(tag)));
}