[Image-SIG] Re: buffer is not large enough

Fredrik Lundh fredrik at pythonware.com
Thu Apr 15 12:10:52 EDT 2004


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>






More information about the Image-SIG mailing list