summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Tenart2018-08-23 20:43:27 +0200
committerAntoine Tenart2018-08-23 20:43:27 +0200
commitf0686216289af394b44482c990012e9056ab0604 (patch)
tree8c62d1a010e7b986a1733ff34dd8bcd8f59acb3e
parentfe09d81ab102f7b1762a7a5a03ee6c19b2439485 (diff)
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>
-rw-r--r--libmat2/images.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmat2/images.py b/libmat2/images.py
index d47536b..faa93a4 100644
--- a/libmat2/images.py
+++ b/libmat2/images.py
@@ -82,7 +82,7 @@ class GdkPixbufAbstractParser(_ImageParser):
82 def remove_all(self): 82 def remove_all(self):
83 _, extension = os.path.splitext(self.filename) 83 _, extension = os.path.splitext(self.filename)
84 pixbuf = GdkPixbuf.Pixbuf.new_from_file(self.filename) 84 pixbuf = GdkPixbuf.Pixbuf.new_from_file(self.filename)
85 if extension == '.jpg': 85 if extension.lower() == '.jpg':
86 extension = '.jpeg' # gdk is picky 86 extension = '.jpeg' # gdk is picky
87 pixbuf.savev(self.output_filename, extension[1:], [], []) 87 pixbuf.savev(self.output_filename, extension[1:], [], [])
88 return True 88 return True