[Image-SIG] PIL 1.1.6 gotcha; Image.frombuffer
Russell E Owen
rowen at cesmail.net
Tue Jan 16 22:32:55 CET 2007
My python code started generating warnings when used with PIL 1.1.6 in
Image.frombuffer. The warning says to specify all arguments, to avoid
problems when a default will change. But either the warning is wrong or
I misread it because I thought it said:
Image.frombuffer(mode, shape, data, "raw", mode, 0, 1)
But when I did this my images were upside down. The final 1 should be -1
if you want the old default behavior. In other words:
Image.frombuffer(mode, size, data)
should be changed to:
Image.frombuffer(mode, size, data, "raw", mode, 0, -1)
-- Russell
P.S. it would be a big help if the manual were explicit about what the
old default orientation was for frombuffer (beyond just warning that it
may change).
More information about the Image-SIG
mailing list