1
0
mirror of synced 2024-11-21 16:54:23 +01:00

Improve the reliability of Gdk-based parsers

This commit is contained in:
jvoisin 2019-12-15 07:05:53 -08:00
parent be24c681ff
commit 2e3496d3d4

View File

@ -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