aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjvoisin <julien.voisin@dustri.org>2019-12-15 07:05:53 -0800
committerjvoisin <julien.voisin@dustri.org>2019-12-15 07:05:53 -0800
commit2e3496d3d49776a83b35e5f72ef50a642f350f58 (patch)
tree16d5502a57ac37d548d46dff018e6ce1f74c888b
parentbe24c681ffe200fdd8021e2862864d55787852f9 (diff)
downloadexternal_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.py6
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