python-pillow/Pillow — pull request #873 by wiredfool (2014-08-26 17:36:03+00:00)
Title: Tiff seek

This is a cleaned up version of #865.

It's having some test issues OMM which go away when the tests are run one file at a time in debug mode, so something is likely subtly wrong.

When run as `./test-installed.py`
```
======================================================================
FAIL: TestFileTiff.test_big_endian
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/erics/Pillow/Tests/test_file_tiff.py", line 96, in test_big_endian
self.assertEqual(im.getpixel((0, 0)), 480)
AssertionError: 0 != 480

======================================================================
FAIL: TestFileTiff.test_little_endian
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/erics/Pillow/Tests/test_file_tiff.py", line 81, in test_little_endian
self.assertEqual(im.getpixel((0, 0)), 480)
AssertionError: 0 != 480

======================================================================
FAIL: TestImageConvert.test_16bit
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/erics/Pillow/Tests/test_image_convert.py", line 44, in test_16bit
self._test_float_conversion(im)
File "/home/erics/Pillow/Tests/test_image_convert.py", line 36, in _test_float_conversion
self.assertEqual(orig, converted)
AssertionError: 0 != 447.0

```

They don't fail when only running the one test file under debug mode:

```
./test-installed.py -v -s Tests/test_file_tiff.py
*** TiffImageFile._open ***
- __first: 8200
- ifh: MM*
tag: ImageWidth (256) - type: short (3) - value: (64,)
tag: ImageLength (257) - type: short (3) - value: (64,)
tag: BitsPerSample (258) - type: short (3) - value: (16,)
tag: Compression (259) - type: short (3) - value: (1,)
tag: PhotometricInterpretation (262) - type: short (3) - value: (1,)
tag: FillOrder (266) - type: short (3) - value: (1,)
tag: DocumentName (269) - type: ascii (2) - value: 12bit.MM.cropped.tif
tag: StripOffsets (273) - type: long (4) - value: (8,)
tag: Orientation (274) - type: short (3) - value: (1,)
tag: SamplesPerPixel (277) - type: short (3) - value: (1,)
tag: RowsPerStrip (278) - type: short (3) - value: (64,)
tag: StripByteCounts (279) - type: long (4) - value: (8192,)
tag: XResolution (282) - type: rational (5) - value: ((1207959552, 16777216),)
tag: YResolution (283) - type: rational (5) - value: ((1207959552, 16777216),)
tag: PlanarConfiguration (284) - type: short (3) - value: (1,)
tag: ResolutionUnit (296) - type: short (3) - value: (2,)
tag: PageNumber (297) - type: short (3) - value: (0, 1)
*** Summary ***
- compression: raw
- photometric_interpretation: 1
- planar_configuration: 1
- fill_order: 1
- size: (64, 64)
format key: ('MM', 1, 1, 1, (16,), ())
- raw mode: I;16B
- pil mode: I;16B
tiles: [('raw', (0, 0, 64, 64), 8, ('I;16B', 0, 1))]
Are we generating the same interpretation ... ok
TestFileTiff.test_32bit_float ... ok
TestFileTiff.test___str__ ... ok
TestFileTiff.test__cvt_res_float ... ok
TestFileTiff.test__cvt_res_int ... ok
TestFileTiff.test__cvt_res_sequence ... ok
TestFileTiff.test__delitem__ ... ok
TestFileTiff.test_big_endian ... ok
TestFileTiff.test_gimp_tiff ... ok
TestFileTiff.test_little_endian ... ok
TestFileTiff.test_load_byte ... ok
TestFileTiff.test_load_double ... ok
TestFileTiff.test_load_float ... ok
TestFileTiff.test_load_string ... ok
TestFileTiff.test_mac_tiff ... ok
TestFileTiff.test_multipage ... ok
TestFileTiff.test_multipage_last_frame ... ok
TestFileTiff.test_sanity ... ok
TestFileTiff.test_seek ... ok
TestFileTiff.test_seek_eof ... ok
TestFileTiff.test_xyres_tiff ... ok

----------------------------------------------------------------------
Ran 21 tests in 0.128s

OK
```