[Image-SIG] problem with numpy.asarray and PIL

Sebastian Haase seb.haase at gmail.com
Thu Aug 6 17:09:34 CEST 2009


>>> import Image
>>> Image.VERSION
'1.1.6'
>>> N.__version__
'1.3.0'
>>> im=Image.open('Desktop/chart_bl.tif')
>>> im2= im.convert('L')
>>> a = N.asarray(im2)
>>> a.shape
(18710, 13228)
>>> a.dtype
uint8
>>> a.sum()
33087362820
>>> a = N.asarray(im)
>>> a.shape
(18710, 13228)
>>> a.dtype
bool
>>> a.sum()
<seg fault>

$: uname -a
Linux DebianMachine 2.6.30-1-amd64 #1 SMP Sun Jul 19 13:41:28 UTC 2009
x86_64 GNU/Linux


-S.



On Thu, Aug 6, 2009 at 3:39 PM, Fredrik Lundh<fredrik at pythonware.com> wrote:
> On Wed, Aug 5, 2009 at 9:52 PM, Guy K. Kloss<g.kloss at massey.ac.nz> wrote:
>> On Wed, 05 Aug 2009 22:57:42 you wrote:
>>> Note that there's been some changes to the numpy interface in 1.1.7,
>>> which was recently tagged for release, even though I haven't gotten
>>> around to cut the tarballs just yet:
>>>
>>>    http://hg.effbot.org/pil-2009-raclette/src/pil-117/
>>
>> One of the biggest problems for the Linux community is, that (at least with
>> Ubuntu) the realeases still feature 1.1.6. Also the upcoming Karmic (9.10)
>> still features the 1.1.6 version, and I doubt it will be upgraded to 1.1.7 in
>> time for release. I'd guess it's frozen already. So, we're going to face for
>> almost another year these troubles of the 1.1.6 release out with the broad
>> users of PIL. And I can understand the resistance to just go and install
>> alternative versions versions past the package management on a broad number of
>> systems (e. g. for universities).
>>
>> That's nothing against your efforts Fredrik, that's just an explanation why
>> you/we will have to face more ongoing usage of outdated package versions.
>
> Sure, but it would still be interesting to know if the 1.1.7 changes
> actually solves this specific problem, so we know if/how it can be
> worked around or monkey patched.
>


More information about the Image-SIG mailing list