[Image-SIG] OverflowError on image save

2009-03-05 Thread Wichert Akkerman
I have a small routine which tries to verify if an uploaded file is a valid image. It works like this: image_data=StringIO(data) try: pil_data=PIL.Image.open(image_data) except IOError: # PIL abuses IOError to report parsing errors raise

Re: [Image-SIG] Image to Matrix to Image.

2009-03-05 Thread Jeff Hull
I am having the same problem. I can not save this image after i edit its data. im = myimage.load() ...do stuff to im... im.save('jeff', JPEG) Traceback (most recent call last): File numberfinder.py, line 116, in module main() File numberfinder.py, line 97, in main imL =

Re: [Image-SIG] Using PIL to merge postscript generated text and png files

2009-03-05 Thread Laura Edward Cannon
As far as I know, line wrapping in PIL has to be done automatically. You need to use the font.getsize(text) method in ImageFont it returns a (width, height) tuple for the given text. A little work will allow you to write a function to split the lines at the appropriate places (I would split the

Re: [Image-SIG] OverflowError on image save

2009-03-05 Thread Fredrik Lundh
Can you print the following attributes for a broken file, before calling load: pil_data.mode pil_data.size pil_data.tile /F 2009/3/3 Wichert Akkerman wich...@simplon.biz: I have a small routine which tries to verify if an uploaded file is a valid image. It works like this:

[Image-SIG] ZLIB (PNG/ZIP) support not available

2009-03-05 Thread Jorge Pereira
Hi, We're trying to install PIL 1.1.6 on a RHEL 4Up4 x64, but we are having some difficulties. Although zlib RHEL's rpms are installed (zlib-1.2.1.2-1.2.i386 and zlib-1.2.1.2-1.2.x86_64), when executing python setup.py build_ext -I, we keep getting the message saying that ZLIB (PNG/ZIP) support

[Image-SIG] PIL 1.1.6, python 64bit on Windows XP x64

2009-03-05 Thread Swan, Tim
Hi, I've been trying to get PIL 1.1.6 working on python 64bit: Python version : 2.5.2 (r252:60911, Feb 21 2008, 13:17:27) [MSC v.1400 64 bit (AMD64)] OS : Windows XP Professional x64 SP2. The installer on the main download page appears to only be valid for 32bit python, causing a variety of

Re: [Image-SIG] ZLIB (PNG/ZIP) support not available

2009-03-05 Thread Karsten Hiddemann
Jorge Pereira schrieb: We’re trying to install PIL 1.1.6 on a RHEL 4Up4 x64, but we are having some difficulties. Although zlib RHEL’s rpms are installed (zlib-1.2.1.2-1.2.i386 and zlib-1.2.1.2-1.2.x86_64), when executing “python setup.py build_ext –I”, we keep getting the message saying

Re: [Image-SIG] ZLIB (PNG/ZIP) support not available

2009-03-05 Thread Fredrik Lundh
I'm not up to date with RHEL packaging, but judging from e.g. http://rpm.pbone.net/index.php3/stat/4/idpl/5602905/com/zlib-1.2.1.2-1.2.x86_64.rpm.html the packages you have are runtime libraries, not development packages (i.e. header files and link libraries are missing). Look for packages

Re: [Image-SIG] ZLIB (PNG/ZIP) support not available

2009-03-05 Thread Tim Hatch
Although zlib RHEL’s rpms are installed (zlib-1.2.1.2-1.2.i386 and zlib-1.2.1.2-1.2.x86_64)... Make sure you have the dev versions of those packages as well, namely zlib-devel, freetype-devel, etc. Tim ___ Image-SIG maillist -

Re: [Image-SIG] PIL 1.1.6, python 64bit on Windows XP x64

2009-03-05 Thread Fredrik Lundh
Thanks for the howto. Now I just need to go find myself a 64-bit box to play with ;-) As for the file descriptor crashes, things like that is usually caused by a mismatch between the C runtime libraries used for core Python and the extension (the file handle is allocated by the Python main