From 75c0a750c1b520bac276fd84e7fa4106e7f975f8 Mon Sep 17 00:00:00 2001 From: matiargs Date: Thu, 18 Jul 2024 15:04:24 +0000 Subject: Keep orientation metadata --- libmat2/images.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libmat2/images.py') 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): -- cgit v1.3