diff --git a/CHANGELOG.md b/CHANGELOG.md index 50b4b72..50d99c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.13.5 - 2023-08-02 +- Keep orientation metadata on jpeg and tiff files + # 0.13.4 - 2023-08-02 - 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): _, extension = os.path.splitext(self.filename) pixbuf = GdkPixbuf.Pixbuf.new_from_file(self.filename) + pixbuf = GdkPixbuf.Pixbuf.apply_embedded_orientation(pixbuf) if extension.lower() == '.jpg': extension = '.jpeg' # gdk is picky elif extension.lower() == '.tif': @@ -138,7 +139,7 @@ class JPGParser(GdkPixbufAbstractParser): 'MIMEType', 'ImageWidth', 'ImageSize', 'BitsPerSample', 'ColorComponents', 'EncodingProcess', 'JFIFVersion', 'ResolutionUnit', 'XResolution', 'YCbCrSubSampling', - 'YResolution', 'Megapixels', 'ImageHeight'} + 'YResolution', 'Megapixels', 'ImageHeight', 'Orientation'} class TiffParser(GdkPixbufAbstractParser): @@ -152,7 +153,7 @@ class TiffParser(GdkPixbufAbstractParser): 'FileInodeChangeDate', 'FileModifyDate', 'FileName', 'FilePermissions', 'FileSize', 'FileType', 'FileTypeExtension', 'ImageHeight', 'ImageSize', - 'ImageWidth', 'MIMEType', 'Megapixels', 'SourceFile'} + 'ImageWidth', 'MIMEType', 'Megapixels', 'SourceFile', 'Orientation'} 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 @@ [project] name = "mat2" -version = "0.13.4" +version = "0.13.5" 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." readme = "README.md" license = {file = "LICENSE"} diff --git a/setup.py b/setup.py index bbdf1d9..d8972fd 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open("README.md", encoding='utf-8') as fh: setuptools.setup( name="mat2", - version='0.13.4', + version='0.13.5', author="Julien (jvoisin) Voisin", author_email="julien.voisin+mat2@dustri.org", 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): 'parser': images.TiffParser, 'meta': {'ImageDescription': 'OLYMPUS DIGITAL CAMERA '}, 'expected_meta': { - 'Orientation': 'Horizontal (normal)', 'ResolutionUnit': 'inches', 'XResolution': 72, 'YResolution': 72