summaryrefslogtreecommitdiff
path: root/libmat2/images.py
diff options
context:
space:
mode:
authormatiargs2024-07-18 15:04:24 +0000
committerjvoisin2024-07-18 15:04:24 +0000
commit75c0a750c1b520bac276fd84e7fa4106e7f975f8 (patch)
tree9141f4feecf87402f328b4669e120122c9aa3813 /libmat2/images.py
parenta47ac01eb626859fda3a25996ed3d9665f6001fe (diff)
Keep orientation metadata
Diffstat (limited to 'libmat2/images.py')
-rw-r--r--libmat2/images.py5
1 files changed, 3 insertions, 2 deletions
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
144class TiffParser(GdkPixbufAbstractParser): 145class 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
158class PPMParser(abstract.AbstractParser): 159class PPMParser(abstract.AbstractParser):