[Image-SIG] ANN: PIL 1.1.6 final (december 3, 2006)

Zachary Pincus zpincus at stanford.edu
Tue Dec 5 02:33:12 CET 2006

Hello all,

>>> - A week or so ago, I reported that PIL loads multi-byte (e.g. 16-
>>> and 32-bit raster data) TIFF files incorrectly if the files were
>>> written as big-endian. (I also and provided a test case and patch.)
>> I noticed the post, but haven't had time to look at it; given my
>> current
>> schedule, it's been hard enough to get 1.1.6 out of the door (and in
>> case you wonder, the 1.1.6 feature set has been frozen for quite some
>> time; the last beta was basically a release candidate).
> No problem. I'll try to provide a minimally-invasive patch to address
> this issue (it's really simple to do -- the code just needs to pass
> the correct byte order to Unpack.c, so hopefully this will count as
> 'low-hanging fruit').

Here is a simple patch to make PIL read TIFFs in big-endian format  
with multibyte pixels properly.

The changes are that the 'pack' and 'unpack' raw modes are now keyed  
to the byte order in the TIFF file, which they were not in the past.  
I also removed attempts to read and write TIFFs with signed 16-bit  
integer pixels into 'I;16S' files, because Unpack.c and Pack.c don't  
have any way to convert rawmode 'I;16S' files to/from user-mode 'I; 
16S'. Now these files are properly read in as 'I'-mode files.

Will this patch make it into a maintenance release 1.1.7? I'd like to  
know whether I should keep a fork of PIL until 1.2 comes out, so that  
people in my lab and others can read image from our microscopes into  
and out of python/numpy.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: tiff-endian2.patch
Type: application/octet-stream
Size: 8288 bytes
Desc: not available
Url : http://mail.python.org/pipermail/image-sig/attachments/20061204/2d8677bf/attachment.obj 

More information about the Image-SIG mailing list