diff options
Diffstat (limited to 'printrecord.py')
-rw-r--r-- | printrecord.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/printrecord.py b/printrecord.py index 65dc48a..f4ada9c 100644 --- a/printrecord.py +++ b/printrecord.py | |||
@@ -28,23 +28,23 @@ import lfrecord | |||
28 | class MyImage(object): | 28 | class MyImage(object): |
29 | def __init__(self, fn): | 29 | def __init__(self, fn): |
30 | if fn: | 30 | if fn: |
31 | image = pyexiv2.Image(fn) | 31 | image = pyexiv2.ImageMetadata(fn) |
32 | image.readMetadata() | 32 | image.read() |
33 | keys = image.exifKeys() | 33 | keys = image.exif_keys |
34 | self.image = image | 34 | self.image = image |
35 | else: | 35 | else: |
36 | keys = [] | 36 | keys = [] |
37 | 37 | ||
38 | def get(key, default=''): | 38 | def get(key, default=''): |
39 | if key in keys: | 39 | if key in keys: |
40 | return image[key] | 40 | return image[key].value |
41 | return default | 41 | return default |
42 | 42 | ||
43 | self.date = get('Exif.Photo.DateTimeOriginal', '') | 43 | self.date = get('Exif.Photo.DateTimeOriginal', '') |
44 | 44 | ||
45 | self.shutter=from_rational(get('Exif.Photo.ExposureTime')) | 45 | self.shutter=str(get('Exif.Photo.ExposureTime')) |
46 | self.aperture=to_fstop(from_rational(get('Exif.Photo.FNumber'))) | 46 | self.aperture=to_fstop(str(get('Exif.Photo.FNumber'))) |
47 | self.lens=from_rational(get('Exif.Photo.FocalLength')) | 47 | self.lens=str(get('Exif.Photo.FocalLength')) |
48 | 48 | ||
49 | self.description=get('Exif.Image.ImageDescription') | 49 | self.description=get('Exif.Image.ImageDescription') |
50 | extras, comments = decode_comments(get('Exif.Photo.UserComment')) | 50 | extras, comments = decode_comments(get('Exif.Photo.UserComment')) |