[Image-SIG] Re: buffer is not large enough
Manik Bali
bali at dkrz.de
Thu Apr 15 12:30:59 EDT 2004
Hi Fredrik
They work like...
>>> import Image
>>> im = Image.open("glc2000_beta3.pgm")
>>> im.size
(40320, 14673)
>>> im.mode
'L'
>>> im.tile
[('raw', (0, 0, 40320, 14673), 18L, ('L', 0, 1))]
>>>
and then when i give anyother command like histogram() etc it gives buffer
not large enough
Rgds
Manik
On Thu, 15 Apr 2004, Fredrik Lundh wrote:
> Manik Bali wrote:
>
> > I am trying to make a histogram() for my pgm image( which is basically a
> > four line header information followed by binary data )
> > And it gives the following error.
> > >>> import Image
> > >>> im=Image.open("glc2000_beta3.pgm")
> > >>> im.histogram()
> > Traceback (most recent call last):
> ...
> > ValueError: buffer is not large enough
> >
> > The size of pgm file is 591614803.
> > Is there a way out..
>
> what does this print:
>
> >>> im = Image.open(filename)
> >>> im.size
> >>> im.mode
> >>> im.tile
>
> does this work?
>
> >>> im = Image.open(filename)
> >>> im.filename = None # disable mapping
> >>> im.load()
> >>> im.histogram()
>
> </F>
>
>
>
>
> _______________________________________________
> Image-SIG maillist - Image-SIG at python.org
> http://mail.python.org/mailman/listinfo/image-sig
>
More information about the Image-SIG
mailing list