[Image-SIG] Information about PythonMagick

Fredrik Lundh fredrik at pythonware.com
Mon Sep 12 20:13:28 CEST 2005


I wrote:

> it's not a known problem, but it looks like it's a 2.4[.1]-specific problem,
> which only affects the int() and float() operations.  this shouldn't be hard
> to fix; I'll see if I can come up with a patch.

it was easier than I thought:

$ diff -u PIL/ImageMath.py~ PIL/ImageMath.py
--- PIL/ImageMath.py~   2005-05-15 12:12:20.000000000 +0200
+++ PIL/ImageMath.py    2005-09-12 20:05:26.000000000 +0200
@@ -153,11 +153,11 @@
     def __ge__(self, other):
         return self.apply("ge", self, other)

-    # conversions
-    def __int__(self):
-        return _Operand(self.im.convert("I"))
-    def __float__(self):
-        return _Operand(self.im.convert("F"))
+# conversions
+def imagemath_int(self):
+    return _Operand(self.im.convert("I"))
+def imagemath_float(self):
+    return _Operand(self.im.convert("F"))

 # logical
 def imagemath_equal(self, other):

</F> 





More information about the Image-SIG mailing list