Python imaging library 是否所有图像都带有Exif方向标记?

Python imaging library 是否所有图像都带有Exif方向标记?,python-imaging-library,exif,Python Imaging Library,Exif,我正在处理不同设备拍摄的图像。我需要根据它们的方向旋转它们,并且我已经了解了Exif标记,其中包括关于方向的数据。 数字2、4、6、8表示图像的方向 当我在Exif中打印出可用的标签时,我没有得到“方向”标签。然而,我发现“方向”是一个值,而不是一个键: {11: 'ProcessingSoftware', 254: 'NewSubfileType', 255: 'SubfileType', 256: 'ImageWidth', 257: 'ImageLength', 258: 'BitsPer

我正在处理不同设备拍摄的图像。我需要根据它们的方向旋转它们,并且我已经了解了Exif标记,其中包括关于方向的数据。 数字2、4、6、8表示图像的方向

当我在Exif中打印出可用的标签时,我没有得到“方向”标签。然而,我发现“方向”是一个值,而不是一个键:

{11: 'ProcessingSoftware', 254: 'NewSubfileType', 255: 'SubfileType', 256: 'ImageWidth', 257: 'ImageLength', 258: 'BitsPerSample', 259: 'Compression', 262: 'PhotometricInterpretation', 263: 'Thresholding', 264: 'CellWidth', 265: 'CellLength', 266: 'FillOrder', 269: 'DocumentName', 270: 'ImageDescription', 271: 'Make', 272: 'Model', 273: 'StripOffsets', 274: 'Orientation', 277: 'SamplesPerPixel', 278: 'RowsPerStrip', 279: 'StripByteCounts', 280: 'MinSampleValue', 281: 'MaxSampleValue', 282: 'XResolution', 283: 'YResolution', 284: 'PlanarConfiguration', 285: 'PageName', 288: 'FreeOffsets', 289: 'FreeByteCounts', 290: 'GrayResponseUnit', 291: 'GrayResponseCurve', 292: 'T4Options', 293: 'T6Options', 296: 'ResolutionUnit', 297: 'PageNumber', 301: 'TransferFunction', 305: 'Software', 306: 'DateTime', 315: 'Artist', 316: 'HostComputer', 317: 'Predictor', 318: 'WhitePoint', ...
键274表示“方向”,但我的理解是“方向”应该是一个键值对,其中方向是键,2,4,6,8是值


有什么想法吗?

这篇文章只供你作为人类理解代码的含义
274
仍然是键,但在图片文件中找不到文本
“方向”