python-imaging/Pillow — pull request #73 by pelson (2013-03-07 12:03:52+00:00)
Title: Added the ``named`` method to a Tiffs tag getter.

I was loading a Tiff file which has some GeoTiff metadata and was being caught out by using the ``im.tag.tags`` public dictionary. This doesn't fix the issue, but makes the solution much more obvious to users (without breaking backwards compatibility or reducing performance):

```
>>> import PIL.Image
>>> im = PIL.Image.open('aklqaa.pyf1c10.subset.tif')

>>> print im.tag.tags
{256: (48,), 257: (71,), 258: (32,), 259: (1,), 262: (1,), 273: (258, 8322), 339: (3,), 278: (42,), 284: (1,)}

>>> print im.tag

{256: (48,), 257: (71,), 258: (32,), 259: (1,), 262: (1,), 33922: (0.0, 0.0, 0.0, -1.875, 88.75, 0.0), 33550: (3.75, 2.5, 0.0), 273: (258, 8322), 339: (3,), 277: (1,), 278: (42,), 279: (8064, 5568), 284: (1,)}

>>> print im.tag.named()
{'PlanarConfiguration': (1,), 'BitsPerSample': (32,), 'ImageLength': (71,), 'Compression': (1,), 'SampleFormat': (3,), 33922: (0.0, 0.0, 0.0, -1.875, 88.75, 0.0), 33550: (3.75, 2.5, 0.0), 'PhotometricInterpretation': (1,), 'RowsPerStrip': (42,), 'ImageWidth': (48,), 'SamplesPerPixel': (1,), 'StripOffsets': (258, 8322), 'StripByteCounts': (8064, 5568)}
```