diff options
| -rw-r--r-- | CHANGELOG.md | 3 | ||||
| -rw-r--r-- | libmat2/images.py | 5 | ||||
| -rw-r--r-- | pyproject.toml | 2 | ||||
| -rw-r--r-- | setup.py | 2 | ||||
| -rw-r--r-- | tests/test_lightweight_cleaning.py | 1 |
5 files changed, 8 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 50b4b72..50d99c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | # 0.13.5 - 2023-08-02 | ||
| 2 | - Keep orientation metadata on jpeg and tiff files | ||
| 3 | |||
| 1 | # 0.13.4 - 2023-08-02 | 4 | # 0.13.4 - 2023-08-02 |
| 2 | 5 | ||
| 3 | - Add documentation about mat2 on OSX | 6 | - Add documentation about mat2 on OSX |
diff --git a/libmat2/images.py b/libmat2/images.py index 254438b..bca1e74 100644 --- a/libmat2/images.py +++ b/libmat2/images.py | |||
| @@ -116,6 +116,7 @@ class GdkPixbufAbstractParser(exiftool.ExiftoolParser): | |||
| 116 | 116 | ||
| 117 | _, extension = os.path.splitext(self.filename) | 117 | _, extension = os.path.splitext(self.filename) |
| 118 | pixbuf = GdkPixbuf.Pixbuf.new_from_file(self.filename) | 118 | pixbuf = GdkPixbuf.Pixbuf.new_from_file(self.filename) |
| 119 | pixbuf = GdkPixbuf.Pixbuf.apply_embedded_orientation(pixbuf) | ||
| 119 | if extension.lower() == '.jpg': | 120 | if extension.lower() == '.jpg': |
| 120 | extension = '.jpeg' # gdk is picky | 121 | extension = '.jpeg' # gdk is picky |
| 121 | elif extension.lower() == '.tif': | 122 | elif extension.lower() == '.tif': |
| @@ -138,7 +139,7 @@ class JPGParser(GdkPixbufAbstractParser): | |||
| 138 | 'MIMEType', 'ImageWidth', 'ImageSize', 'BitsPerSample', | 139 | 'MIMEType', 'ImageWidth', 'ImageSize', 'BitsPerSample', |
| 139 | 'ColorComponents', 'EncodingProcess', 'JFIFVersion', | 140 | 'ColorComponents', 'EncodingProcess', 'JFIFVersion', |
| 140 | 'ResolutionUnit', 'XResolution', 'YCbCrSubSampling', | 141 | 'ResolutionUnit', 'XResolution', 'YCbCrSubSampling', |
| 141 | 'YResolution', 'Megapixels', 'ImageHeight'} | 142 | 'YResolution', 'Megapixels', 'ImageHeight', 'Orientation'} |
| 142 | 143 | ||
| 143 | 144 | ||
| 144 | class TiffParser(GdkPixbufAbstractParser): | 145 | class TiffParser(GdkPixbufAbstractParser): |
| @@ -152,7 +153,7 @@ class TiffParser(GdkPixbufAbstractParser): | |||
| 152 | 'FileInodeChangeDate', 'FileModifyDate', 'FileName', | 153 | 'FileInodeChangeDate', 'FileModifyDate', 'FileName', |
| 153 | 'FilePermissions', 'FileSize', 'FileType', | 154 | 'FilePermissions', 'FileSize', 'FileType', |
| 154 | 'FileTypeExtension', 'ImageHeight', 'ImageSize', | 155 | 'FileTypeExtension', 'ImageHeight', 'ImageSize', |
| 155 | 'ImageWidth', 'MIMEType', 'Megapixels', 'SourceFile'} | 156 | 'ImageWidth', 'MIMEType', 'Megapixels', 'SourceFile', 'Orientation'} |
| 156 | 157 | ||
| 157 | 158 | ||
| 158 | class PPMParser(abstract.AbstractParser): | 159 | class PPMParser(abstract.AbstractParser): |
diff --git a/pyproject.toml b/pyproject.toml index a52ee41..62912b1 100644 --- a/pyproject.toml +++ b/pyproject.toml | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | [project] | 1 | [project] |
| 2 | name = "mat2" | 2 | name = "mat2" |
| 3 | version = "0.13.4" | 3 | version = "0.13.5" |
| 4 | description = "mat2 is a metadata removal tool, supporting a wide range of commonly used file formats, written in python3: at its core, it's a library, used by an eponymous command-line interface, as well as several file manager extensions." | 4 | description = "mat2 is a metadata removal tool, supporting a wide range of commonly used file formats, written in python3: at its core, it's a library, used by an eponymous command-line interface, as well as several file manager extensions." |
| 5 | readme = "README.md" | 5 | readme = "README.md" |
| 6 | license = {file = "LICENSE"} | 6 | license = {file = "LICENSE"} |
| @@ -5,7 +5,7 @@ with open("README.md", encoding='utf-8') as fh: | |||
| 5 | 5 | ||
| 6 | setuptools.setup( | 6 | setuptools.setup( |
| 7 | name="mat2", | 7 | name="mat2", |
| 8 | version='0.13.4', | 8 | version='0.13.5', |
| 9 | author="Julien (jvoisin) Voisin", | 9 | author="Julien (jvoisin) Voisin", |
| 10 | author_email="julien.voisin+mat2@dustri.org", | 10 | author_email="julien.voisin+mat2@dustri.org", |
| 11 | description="A handy tool to trash your metadata", | 11 | description="A handy tool to trash your metadata", |
diff --git a/tests/test_lightweight_cleaning.py b/tests/test_lightweight_cleaning.py index 38e06dc..ce7e48c 100644 --- a/tests/test_lightweight_cleaning.py +++ b/tests/test_lightweight_cleaning.py | |||
| @@ -33,7 +33,6 @@ class TestLightWeightCleaning(unittest.TestCase): | |||
| 33 | 'parser': images.TiffParser, | 33 | 'parser': images.TiffParser, |
| 34 | 'meta': {'ImageDescription': 'OLYMPUS DIGITAL CAMERA '}, | 34 | 'meta': {'ImageDescription': 'OLYMPUS DIGITAL CAMERA '}, |
| 35 | 'expected_meta': { | 35 | 'expected_meta': { |
| 36 | 'Orientation': 'Horizontal (normal)', | ||
| 37 | 'ResolutionUnit': 'inches', | 36 | 'ResolutionUnit': 'inches', |
| 38 | 'XResolution': 72, | 37 | 'XResolution': 72, |
| 39 | 'YResolution': 72 | 38 | 'YResolution': 72 |
