Image.frombuffer and warning
News123
news123 at free.fr
Wed Mar 3 04:44:26 EST 2010
Hi Peter,
Peter Otten wrote:
> News123 wrote:
> I cannot reproduce the problem:
>
> $ cat frombuffer.py
> import sys
> import Image
> wx = 3
> wy = 2
> buf = "a"*wx*wy
> if "--fixed" in sys.argv:
> Image.frombuffer("L", (wx, wy), buf, "raw", "L", 0, 1)
> else:
> Image.frombuffer("L", (wx, wy), buf)
>
> $ python frombuffer.py
> frombuffer.py:9: RuntimeWarning: the frombuffer defaults may change in a
> future release; for portability, change the call to read:
> frombuffer(mode, size, data, 'raw', mode, 0, 1)
> Image.frombuffer("L", (wx, wy), buf)
> $ python frombuffer.py --fixed
> $ python -c"import Image; print Image.VERSION"
> 1.1.6
> $ python -V
> Python 2.6.4
>
> Peter
You're absolutely right. It was my error.
I shouldn't do any lat night coding :-(.
I fixed one frombuffer() statement, but overlooked a second one in my
code :-(
Apologies
N
More information about the Python-list
mailing list