From be24c681ffe200fdd8021e2862864d55787852f9 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 15 Dec 2019 06:57:32 -0800 Subject: [PATCH] Improve the reliability of PNG parsing --- libmat2/images.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libmat2/images.py b/libmat2/images.py index 18fe4d3..da42258 100644 --- a/libmat2/images.py +++ b/libmat2/images.py @@ -63,7 +63,8 @@ class PNGParser(exiftool.ExiftoolParser): try: # better fail here than later cairo.ImageSurface.create_from_png(self.filename) - except MemoryError: # pragma: no cover + except Exception: # pragma: no cover + # Cairo is returning some weird exceptions :/ raise ValueError def remove_all(self) -> bool: