[Numpy-discussion] Forward from PIL list...

Christopher Barker Chris.Barker at noaa.gov
Mon Dec 4 11:18:53 CST 2006

Hi all,

PIL 1.1.6 final was just released, which includes support for the numpy 
array interface. However, this just came out on the list:

Zachary Pincus wrote:
> - The 'fromarray' command is a bit broken in Image.py:
> Specifically, the following stanza is incorrect --
>      if mode is None:
>          typestr = arr['typestr']
>          if not (typestr[0] == '|' or typestr[0] == _ENDIAN or
>                  typestr[1:] not in ['u1', 'b1', 'i4', 'f4']):
>              raise TypeError("cannot handle data-type")
>          typestr = typestr[:2]
>          if typestr == 'i4':
> 		...
> The error is that 'typestr = typestr[:2]' should instead be 'typestr  
> = typestr[1:]'

that code was contributed by the numpy developers, but it sure looks
broken.  hmm.

Maybe someone who knows better than me can send a not to the PIL list.


Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov

More information about the Numpy-discussion mailing list