diff options
author | jvoisin <julien.voisin@dustri.org> | 2019-12-15 07:05:53 -0800 |
---|---|---|
committer | jvoisin <julien.voisin@dustri.org> | 2019-12-15 07:05:53 -0800 |
commit | 2e3496d3d49776a83b35e5f72ef50a642f350f58 (patch) | |
tree | 16d5502a57ac37d548d46dff018e6ce1f74c888b | |
parent | be24c681ffe200fdd8021e2862864d55787852f9 (diff) | |
download | external_mat2-2e3496d3d49776a83b35e5f72ef50a642f350f58.tar.gz external_mat2-2e3496d3d49776a83b35e5f72ef50a642f350f58.tar.bz2 external_mat2-2e3496d3d49776a83b35e5f72ef50a642f350f58.zip |
Improve the reliability of Gdk-based parsers
-rw-r--r-- | libmat2/images.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libmat2/images.py b/libmat2/images.py index da42258..6066b07 100644 --- a/libmat2/images.py +++ b/libmat2/images.py @@ -112,7 +112,11 @@ class GdkPixbufAbstractParser(exiftool.ExiftoolParser): pixbuf = GdkPixbuf.Pixbuf.new_from_file(self.filename) if extension.lower() == '.jpg': extension = '.jpeg' # gdk is picky - pixbuf.savev(self.output_filename, type=extension[1:], option_keys=[], option_values=[]) + try: + pixbuf.savev(self.output_filename, type=extension[1:], + option_keys=[], option_values=[]) + except GLib.GError: # pragma: no cover + return False return True |