aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2009-10-05 10:03:31 +0200
committerOlivier Tilloy <olivier@fluendo.com>2009-10-05 10:03:31 +0200
commit59a385ba4c24fd08203a324bc1abd947a04ee8af (patch)
tree4413215b2902ebb74ffd579b9c01910d12d258c0
parent0718a31837785f89543e4bce13e8bbf872cdecdc (diff)
downloadpyexiv2-59a385ba4c24fd08203a324bc1abd947a04ee8af.tar.gz
Added a quick main that kind of mimics the output of exiv2 for an image.
-rw-r--r--src/pyexiv2.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/pyexiv2.py b/src/pyexiv2.py
index 1cf7eb5..2a1d6ba 100644
--- a/src/pyexiv2.py
+++ b/src/pyexiv2.py
@@ -1550,3 +1550,21 @@ class ImageMetadata(object):
except AttributeError:
raise KeyError(key)
+
+if __name__ == '__main__':
+ import sys
+ args = sys.argv
+
+ if len(args) != 2:
+ print 'Usage: %s image_file' % args[0]
+ sys.exit(-1)
+
+ metadata = ImageMetadata(args[1])
+ metadata.read()
+
+ for key in metadata.exif_keys:
+ tag = metadata[key]
+ print '%-45s%-11s%s' % (key, tag.type, str(tag))
+
+ # TODO: print IPTC and XMP tags.
+