[Image-SIG] Re: Image.eval problem with math.sqrt

Alan Grosskurth alan.grosskurth at utoronto.ca
Mon Jul 14 01:10:21 EDT 2003


> It looks like the arguments in the documentation are reversed. Should
> be:
> 
>     out = Image.eval(im, math.sqrt)

Thanks for the help, Bill. That works fine for 8-bit images, but I'm
still have trouble with mode 'I' images (32-bit integer):

    image = Image.new('I', (10, 10))
    out = Image.eval(image, math.sqrt)

And I get this error:

    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
      File "/h/45/grosskur/lib/python2.2/site-packages/PIL/Image.py", line
      1634, in eval
        return image.point(args[0])
      File "/h/45/grosskur/lib/python2.2/site-packages/PIL/Image.py", line
      924, in point
        scale, offset = _getscaleoffset(lut)
      File "/h/45/grosskur/lib/python2.2/site-packages/PIL/Image.py", line
      339, in _getscaleoffset
        data = expr(_E(stub)).data
    AttributeError: _E instance has no attribute '__float__'

Any help is appreciated.

Thanks,
Alan



More information about the Image-SIG mailing list