summaryrefslogtreecommitdiff
path: root/src/images.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/images.py')
-rw-r--r--src/images.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/images.py b/src/images.py
index 7c1abaa..6cc3dfe 100644
--- a/src/images.py
+++ b/src/images.py
@@ -20,6 +20,13 @@ class PNGParser(abstract.AbstractParser):
20 'Compression', 'Filter', 'Interlace', 'BackgroundColor', 'ImageSize', 20 'Compression', 'Filter', 'Interlace', 'BackgroundColor', 'ImageSize',
21 'Megapixels', 'ImageHeight'} 21 'Megapixels', 'ImageHeight'}
22 22
23 def __init__(self, filename):
24 super().__init__(filename)
25 try: # better fail here than later
26 cairo.ImageSurface.create_from_png(self.filename)
27 except MemoryError:
28 raise ValueError
29
23 def get_meta(self): 30 def get_meta(self):
24 out = subprocess.check_output(['/usr/bin/exiftool', '-json', self.filename]) 31 out = subprocess.check_output(['/usr/bin/exiftool', '-json', self.filename])
25 meta = json.loads(out.decode('utf-8'))[0] 32 meta = json.loads(out.decode('utf-8'))[0]