1
0
Fork 0

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
1 changed files with 5 additions and 1 deletions

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