1
0
镜像自地址 已同步 2025-07-01 02:57:53 +02: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>
这个提交包含在:
Antoine Tenart 2018-08-23 20:43:27 +02:00
父节点 fe09d81ab1
当前提交 f068621628

查看文件

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