ExifTags.py 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. #
  2. # The Python Imaging Library.
  3. # $Id$
  4. #
  5. # EXIF tags
  6. #
  7. # Copyright (c) 2003 by Secret Labs AB
  8. #
  9. # See the README file for information on usage and redistribution.
  10. #
  11. """
  12. This module provides constants and clear-text names for various
  13. well-known EXIF tags.
  14. """
  15. TAGS = {
  16. # possibly incomplete
  17. 0x000B: "ProcessingSoftware",
  18. 0x00FE: "NewSubfileType",
  19. 0x00FF: "SubfileType",
  20. 0x0100: "ImageWidth",
  21. 0x0101: "ImageLength",
  22. 0x0102: "BitsPerSample",
  23. 0x0103: "Compression",
  24. 0x0106: "PhotometricInterpretation",
  25. 0x0107: "Thresholding",
  26. 0x0108: "CellWidth",
  27. 0x0109: "CellLength",
  28. 0x010A: "FillOrder",
  29. 0x010D: "DocumentName",
  30. 0x010E: "ImageDescription",
  31. 0x010F: "Make",
  32. 0x0110: "Model",
  33. 0x0111: "StripOffsets",
  34. 0x0112: "Orientation",
  35. 0x0115: "SamplesPerPixel",
  36. 0x0116: "RowsPerStrip",
  37. 0x0117: "StripByteCounts",
  38. 0x0118: "MinSampleValue",
  39. 0x0119: "MaxSampleValue",
  40. 0x011A: "XResolution",
  41. 0x011B: "YResolution",
  42. 0x011C: "PlanarConfiguration",
  43. 0x011D: "PageName",
  44. 0x0120: "FreeOffsets",
  45. 0x0121: "FreeByteCounts",
  46. 0x0122: "GrayResponseUnit",
  47. 0x0123: "GrayResponseCurve",
  48. 0x0124: "T4Options",
  49. 0x0125: "T6Options",
  50. 0x0128: "ResolutionUnit",
  51. 0x0129: "PageNumber",
  52. 0x012D: "TransferFunction",
  53. 0x0131: "Software",
  54. 0x0132: "DateTime",
  55. 0x013B: "Artist",
  56. 0x013C: "HostComputer",
  57. 0x013D: "Predictor",
  58. 0x013E: "WhitePoint",
  59. 0x013F: "PrimaryChromaticities",
  60. 0x0140: "ColorMap",
  61. 0x0141: "HalftoneHints",
  62. 0x0142: "TileWidth",
  63. 0x0143: "TileLength",
  64. 0x0144: "TileOffsets",
  65. 0x0145: "TileByteCounts",
  66. 0x014A: "SubIFDs",
  67. 0x014C: "InkSet",
  68. 0x014D: "InkNames",
  69. 0x014E: "NumberOfInks",
  70. 0x0150: "DotRange",
  71. 0x0151: "TargetPrinter",
  72. 0x0152: "ExtraSamples",
  73. 0x0153: "SampleFormat",
  74. 0x0154: "SMinSampleValue",
  75. 0x0155: "SMaxSampleValue",
  76. 0x0156: "TransferRange",
  77. 0x0157: "ClipPath",
  78. 0x0158: "XClipPathUnits",
  79. 0x0159: "YClipPathUnits",
  80. 0x015A: "Indexed",
  81. 0x015B: "JPEGTables",
  82. 0x015F: "OPIProxy",
  83. 0x0200: "JPEGProc",
  84. 0x0201: "JpegIFOffset",
  85. 0x0202: "JpegIFByteCount",
  86. 0x0203: "JpegRestartInterval",
  87. 0x0205: "JpegLosslessPredictors",
  88. 0x0206: "JpegPointTransforms",
  89. 0x0207: "JpegQTables",
  90. 0x0208: "JpegDCTables",
  91. 0x0209: "JpegACTables",
  92. 0x0211: "YCbCrCoefficients",
  93. 0x0212: "YCbCrSubSampling",
  94. 0x0213: "YCbCrPositioning",
  95. 0x0214: "ReferenceBlackWhite",
  96. 0x02BC: "XMLPacket",
  97. 0x1000: "RelatedImageFileFormat",
  98. 0x1001: "RelatedImageWidth",
  99. 0x1002: "RelatedImageLength",
  100. 0x4746: "Rating",
  101. 0x4749: "RatingPercent",
  102. 0x800D: "ImageID",
  103. 0x828D: "CFARepeatPatternDim",
  104. 0x828E: "CFAPattern",
  105. 0x828F: "BatteryLevel",
  106. 0x8298: "Copyright",
  107. 0x829A: "ExposureTime",
  108. 0x829D: "FNumber",
  109. 0x83BB: "IPTCNAA",
  110. 0x8649: "ImageResources",
  111. 0x8769: "ExifOffset",
  112. 0x8773: "InterColorProfile",
  113. 0x8822: "ExposureProgram",
  114. 0x8824: "SpectralSensitivity",
  115. 0x8825: "GPSInfo",
  116. 0x8827: "ISOSpeedRatings",
  117. 0x8828: "OECF",
  118. 0x8829: "Interlace",
  119. 0x882A: "TimeZoneOffset",
  120. 0x882B: "SelfTimerMode",
  121. 0x9000: "ExifVersion",
  122. 0x9003: "DateTimeOriginal",
  123. 0x9004: "DateTimeDigitized",
  124. 0x9101: "ComponentsConfiguration",
  125. 0x9102: "CompressedBitsPerPixel",
  126. 0x9201: "ShutterSpeedValue",
  127. 0x9202: "ApertureValue",
  128. 0x9203: "BrightnessValue",
  129. 0x9204: "ExposureBiasValue",
  130. 0x9205: "MaxApertureValue",
  131. 0x9206: "SubjectDistance",
  132. 0x9207: "MeteringMode",
  133. 0x9208: "LightSource",
  134. 0x9209: "Flash",
  135. 0x920A: "FocalLength",
  136. 0x920B: "FlashEnergy",
  137. 0x920C: "SpatialFrequencyResponse",
  138. 0x920D: "Noise",
  139. 0x9211: "ImageNumber",
  140. 0x9212: "SecurityClassification",
  141. 0x9213: "ImageHistory",
  142. 0x9214: "SubjectLocation",
  143. 0x9215: "ExposureIndex",
  144. 0x9216: "TIFF/EPStandardID",
  145. 0x927C: "MakerNote",
  146. 0x9286: "UserComment",
  147. 0x9290: "SubsecTime",
  148. 0x9291: "SubsecTimeOriginal",
  149. 0x9292: "SubsecTimeDigitized",
  150. 0x9400: "AmbientTemperature",
  151. 0x9401: "Humidity",
  152. 0x9402: "Pressure",
  153. 0x9403: "WaterDepth",
  154. 0x9404: "Acceleration",
  155. 0x9405: "CameraElevationAngle",
  156. 0x9C9B: "XPTitle",
  157. 0x9C9C: "XPComment",
  158. 0x9C9D: "XPAuthor",
  159. 0x9C9E: "XPKeywords",
  160. 0x9C9F: "XPSubject",
  161. 0xA000: "FlashPixVersion",
  162. 0xA001: "ColorSpace",
  163. 0xA002: "ExifImageWidth",
  164. 0xA003: "ExifImageHeight",
  165. 0xA004: "RelatedSoundFile",
  166. 0xA005: "ExifInteroperabilityOffset",
  167. 0xA20B: "FlashEnergy",
  168. 0xA20C: "SpatialFrequencyResponse",
  169. 0xA20E: "FocalPlaneXResolution",
  170. 0xA20F: "FocalPlaneYResolution",
  171. 0xA210: "FocalPlaneResolutionUnit",
  172. 0xA214: "SubjectLocation",
  173. 0xA215: "ExposureIndex",
  174. 0xA217: "SensingMethod",
  175. 0xA300: "FileSource",
  176. 0xA301: "SceneType",
  177. 0xA302: "CFAPattern",
  178. 0xA401: "CustomRendered",
  179. 0xA402: "ExposureMode",
  180. 0xA403: "WhiteBalance",
  181. 0xA404: "DigitalZoomRatio",
  182. 0xA405: "FocalLengthIn35mmFilm",
  183. 0xA406: "SceneCaptureType",
  184. 0xA407: "GainControl",
  185. 0xA408: "Contrast",
  186. 0xA409: "Saturation",
  187. 0xA40A: "Sharpness",
  188. 0xA40B: "DeviceSettingDescription",
  189. 0xA40C: "SubjectDistanceRange",
  190. 0xA420: "ImageUniqueID",
  191. 0xA430: "CameraOwnerName",
  192. 0xA431: "BodySerialNumber",
  193. 0xA432: "LensSpecification",
  194. 0xA433: "LensMake",
  195. 0xA434: "LensModel",
  196. 0xA435: "LensSerialNumber",
  197. 0xA500: "Gamma",
  198. 0xC4A5: "PrintImageMatching",
  199. 0xC612: "DNGVersion",
  200. 0xC613: "DNGBackwardVersion",
  201. 0xC614: "UniqueCameraModel",
  202. 0xC615: "LocalizedCameraModel",
  203. 0xC616: "CFAPlaneColor",
  204. 0xC617: "CFALayout",
  205. 0xC618: "LinearizationTable",
  206. 0xC619: "BlackLevelRepeatDim",
  207. 0xC61A: "BlackLevel",
  208. 0xC61B: "BlackLevelDeltaH",
  209. 0xC61C: "BlackLevelDeltaV",
  210. 0xC61D: "WhiteLevel",
  211. 0xC61E: "DefaultScale",
  212. 0xC61F: "DefaultCropOrigin",
  213. 0xC620: "DefaultCropSize",
  214. 0xC621: "ColorMatrix1",
  215. 0xC622: "ColorMatrix2",
  216. 0xC623: "CameraCalibration1",
  217. 0xC624: "CameraCalibration2",
  218. 0xC625: "ReductionMatrix1",
  219. 0xC626: "ReductionMatrix2",
  220. 0xC627: "AnalogBalance",
  221. 0xC628: "AsShotNeutral",
  222. 0xC629: "AsShotWhiteXY",
  223. 0xC62A: "BaselineExposure",
  224. 0xC62B: "BaselineNoise",
  225. 0xC62C: "BaselineSharpness",
  226. 0xC62D: "BayerGreenSplit",
  227. 0xC62E: "LinearResponseLimit",
  228. 0xC62F: "CameraSerialNumber",
  229. 0xC630: "LensInfo",
  230. 0xC631: "ChromaBlurRadius",
  231. 0xC632: "AntiAliasStrength",
  232. 0xC633: "ShadowScale",
  233. 0xC634: "DNGPrivateData",
  234. 0xC635: "MakerNoteSafety",
  235. 0xC65A: "CalibrationIlluminant1",
  236. 0xC65B: "CalibrationIlluminant2",
  237. 0xC65C: "BestQualityScale",
  238. 0xC65D: "RawDataUniqueID",
  239. 0xC68B: "OriginalRawFileName",
  240. 0xC68C: "OriginalRawFileData",
  241. 0xC68D: "ActiveArea",
  242. 0xC68E: "MaskedAreas",
  243. 0xC68F: "AsShotICCProfile",
  244. 0xC690: "AsShotPreProfileMatrix",
  245. 0xC691: "CurrentICCProfile",
  246. 0xC692: "CurrentPreProfileMatrix",
  247. 0xC6BF: "ColorimetricReference",
  248. 0xC6F3: "CameraCalibrationSignature",
  249. 0xC6F4: "ProfileCalibrationSignature",
  250. 0xC6F6: "AsShotProfileName",
  251. 0xC6F7: "NoiseReductionApplied",
  252. 0xC6F8: "ProfileName",
  253. 0xC6F9: "ProfileHueSatMapDims",
  254. 0xC6FA: "ProfileHueSatMapData1",
  255. 0xC6FB: "ProfileHueSatMapData2",
  256. 0xC6FC: "ProfileToneCurve",
  257. 0xC6FD: "ProfileEmbedPolicy",
  258. 0xC6FE: "ProfileCopyright",
  259. 0xC714: "ForwardMatrix1",
  260. 0xC715: "ForwardMatrix2",
  261. 0xC716: "PreviewApplicationName",
  262. 0xC717: "PreviewApplicationVersion",
  263. 0xC718: "PreviewSettingsName",
  264. 0xC719: "PreviewSettingsDigest",
  265. 0xC71A: "PreviewColorSpace",
  266. 0xC71B: "PreviewDateTime",
  267. 0xC71C: "RawImageDigest",
  268. 0xC71D: "OriginalRawFileDigest",
  269. 0xC71E: "SubTileBlockSize",
  270. 0xC71F: "RowInterleaveFactor",
  271. 0xC725: "ProfileLookTableDims",
  272. 0xC726: "ProfileLookTableData",
  273. 0xC740: "OpcodeList1",
  274. 0xC741: "OpcodeList2",
  275. 0xC74E: "OpcodeList3",
  276. 0xC761: "NoiseProfile",
  277. }
  278. """Maps EXIF tags to tag names."""
  279. GPSTAGS = {
  280. 0: "GPSVersionID",
  281. 1: "GPSLatitudeRef",
  282. 2: "GPSLatitude",
  283. 3: "GPSLongitudeRef",
  284. 4: "GPSLongitude",
  285. 5: "GPSAltitudeRef",
  286. 6: "GPSAltitude",
  287. 7: "GPSTimeStamp",
  288. 8: "GPSSatellites",
  289. 9: "GPSStatus",
  290. 10: "GPSMeasureMode",
  291. 11: "GPSDOP",
  292. 12: "GPSSpeedRef",
  293. 13: "GPSSpeed",
  294. 14: "GPSTrackRef",
  295. 15: "GPSTrack",
  296. 16: "GPSImgDirectionRef",
  297. 17: "GPSImgDirection",
  298. 18: "GPSMapDatum",
  299. 19: "GPSDestLatitudeRef",
  300. 20: "GPSDestLatitude",
  301. 21: "GPSDestLongitudeRef",
  302. 22: "GPSDestLongitude",
  303. 23: "GPSDestBearingRef",
  304. 24: "GPSDestBearing",
  305. 25: "GPSDestDistanceRef",
  306. 26: "GPSDestDistance",
  307. 27: "GPSProcessingMethod",
  308. 28: "GPSAreaInformation",
  309. 29: "GPSDateStamp",
  310. 30: "GPSDifferential",
  311. 31: "GPSHPositioningError",
  312. }
  313. """Maps EXIF GPS tags to tag names."""