From f0686216289af394b44482c990012e9056ab0604 Mon Sep 17 00:00:00 2001
From: Antoine Tenart <antoine.tenart@ack.tf>
Date: Thu, 23 Aug 2018 20:43:27 +0200
Subject: [PATCH] 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>
---
 libmat2/images.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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):
     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
-- 
GitLab