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>
这个提交包含在:
父节点
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
|
||||||
|
正在加载...
x
在新工单中引用
屏蔽一个用户