diff options
| author | Antoine Tenart | 2018-08-23 20:43:27 +0200 |
|---|---|---|
| committer | Antoine Tenart | 2018-08-23 20:43:27 +0200 |
| commit | f0686216289af394b44482c990012e9056ab0604 (patch) | |
| tree | 8c62d1a010e7b986a1733ff34dd8bcd8f59acb3e /libmat2 | |
| parent | fe09d81ab102f7b1762a7a5a03ee6c19b2439485 (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>
Diffstat (limited to 'libmat2')
| -rw-r--r-- | libmat2/images.py | 2 |
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 |
