1
0
mirror of synced 2024-11-22 01:04:23 +01:00

libmat2: images: fix handling of .JPG files

Pixbuf only supports .jpeg files, not .jpg, so libmat2 looks for such an
extension and converts it if necessary. As this check is case sensitive,
processing .JPG files does not work.

Fixes #47.

Signed-off-by: Antoine Tenart <antoine.tenart@ack.tf>
This commit is contained in:
Antoine Tenart 2018-08-23 20:43:27 +02:00
parent fe09d81ab1
commit f068621628

View File

@ -82,7 +82,7 @@ class GdkPixbufAbstractParser(_ImageParser):
def remove_all(self):
_, extension = os.path.splitext(self.filename)
pixbuf = GdkPixbuf.Pixbuf.new_from_file(self.filename)
if extension == '.jpg':
if extension.lower() == '.jpg':
extension = '.jpeg' # gdk is picky
pixbuf.savev(self.output_filename, extension[1:], [], [])
return True