← Back to team overview

phatch-dev team mailing list archive

minimal supported version of python is 2.4

 

Hi,
There was an error of users installing through the PPA, because some
code was not compatible with python 2.4. So in order to make Phatch
compatible with all installed versions of ubuntu, please don't use
python 2.5 specific code:
$ bzr diff -r-2
=== modified file 'phatch/core/pil.py'
--- phatch/core/pil.py	2009-06-03 03:04:57 +0000
+++ phatch/core/pil.py	2009-06-04 14:28:02 +0000
@@ -80,6 +80,12 @@
     if not(libtiff or compression in ['raw','None']):
         raise Exception('Libtiff tools are needed for "%s" compression'\
             %compression)
+
+def treshold(a):
+    if a <= 128:
+        return 255
+    else:
+        return 0

 def image_open(x):
     if is_www_file(x):
@@ -417,7 +423,7 @@
                     mode, colors=255, *args, **keyw
                 )
                 layer.image.paste(
-                    255, Image.eval(alpha, lambda a: 255 if a <=128 else 0)
+                    255, Image.eval(alpha, treshold)
                 )
                 self.info['transparency'] = 255
             else:

I don't blame anyone, I didn't know this myself.
Best regards,
Stani

-- 
Phatch Photo Batch Processor - http://photobatch.stani.be
SPE Python IDE - http://pythonide.stani.be