Image
Fredrik Lundh
fredrik at pythonware.com
Wed Aug 11 07:57:45 EDT 2004
Sheldon wrote:
> im = Image.fromstring('I', (81,81),array)
> gives the valueError: data not enough...
>
> The tutorial on Image leaves a lot to be desired.
the same can be said about your ability to cut and paste: the error message
is "not enough image data" and means exactly what it says.
(in other words, the "array" variable contains less than 81*81*4 bytes)
are you running this on Windows? if so, you need to specify that the file
contains binary data when you open it:
f = open(filename, "wb") # open for writing
f = open(filename, "rb") # open for reading
see
http://docs.python.org/lib/built-in-funcs.html#l2h-25
for more details.
</F>
More information about the Python-list
mailing list