TiffTags Module

The TiffTags module exposes many of the standard TIFFmetadata tag numbers, names, and type information.

参数:tag – Integer tag number返回:Taginfo namedtuple, From the TAGS_V2 info if possible,otherwise just populating the value and name from TAGS.If the tag is not recognized, “unknown” is returned for the name

3.1.0 新版功能.

  • class PIL.TiffTags.TagInfo[源代码]
    • init(self, value=None, name="unknown", type=None, length=0, enum=None)

参数:

  1. - **value** Integer Tag Number
  2. - **name** Tag Name
  3. - **type** Integer type from [<code>PIL.TiffTags.TYPES</code>](#PIL.TiffTags.PIL.TiffTags.TYPES)
  4. - **length** Array length: 0 == variable, 1 == single value, n = fixed
  5. - **enum** Dict of name:integer value options for an enumeration

参数:value – The enumerated value name返回:The integer corresponding to the name.

3.0.0 新版功能.

  • PIL.TiffTags.TAGS_V2
  • The TAGS_V2 dictionary maps 16-bit integer tag numbers toPIL.TagTypes.TagInfo tuples for metadata fields defined in the TIFFspec.

3.0.0 新版功能.

  • PIL.TiffTags.TAGS
  • The TAGS dictionary maps 16-bit integer TIFF tag number todescriptive string names. For instance:
  1. >>> from PIL.TiffTags import TAGS
  2. >>> TAGS[0x010e]
  3. 'ImageDescription'

This dictionary contains a superset of the tags in TAGS_V2, commonEXIF tags, and other well known metadata tags.

  • PIL.TiffTags.TYPES
  • The TYPES dictionary maps the TIFF type short integer to ahuman readable type name.