From izakmarais at yahoo.com Mon Sep 4 08:59:36 2006 From: izakmarais at yahoo.com (izak marais) Date: Sun, 3 Sep 2006 23:59:36 -0700 (PDT) Subject: [Image-SIG] save() question/bug Message-ID: <20060904065936.10661.qmail@web50908.mail.yahoo.com> Thanks for the reply Frederik What I had been doing was first using fp = open("test.bmp","w") im.save(fp, "BMP") fp.close() This caused the image to save skew. Just using a string in the argument to save instead of a filepointer works. I thought you had to use a file pointer since the function definition is: im.save(self, fp, format = None, **params) Cheers! --------------------------------- All-new Yahoo! Mail - Fire up a more powerful email and get things done faster. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060903/e9dd4932/attachment.htm From fredrik at pythonware.com Mon Sep 4 12:51:53 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 4 Sep 2006 12:51:53 +0200 Subject: [Image-SIG] save() question/bug References: <20060904065936.10661.qmail@web50908.mail.yahoo.com> Message-ID: "izak marais" wrote: > What I had been doing was first using > > fp = open("test.bmp","w") that opens the file in *text* mode, which, among other things, means that the line feed character (chr(10)) is mapped to the native line ending on some plat- forms. to open a file for writing in binary mode, use open(filename, "wb"). From floyd at stsci.edu Mon Sep 4 17:25:12 2006 From: floyd at stsci.edu (David Floyd) Date: Mon, 4 Sep 2006 11:25:12 -0400 Subject: [Image-SIG] (no subject) Message-ID: <2E665A3C-61C9-4303-8CD8-EDD5BFC8C5B6@stsci.edu> Dear Python Image SIG mailing list I am having little difficulty installing Python Imaging Library 1.1.5 Source Kit on my Mac Powerbook G4 (under MacOS 10.4). OS details: > uname -a Darwin dhcp04.lco.cl 8.7.0 Darwin Kernel Version 8.7.0: Fri May 26 15:20:53 PDT 2006; root:xnu-792.6.76.obj~1/RELEASE_PPC Power Macintosh powerpc Running the python setup script halts when it tries to find a gcc compiler at /usr/local/gnu/bin/gcc: > python setup.py install running install running build running build_py running build_ext --- using frameworks at /System/Library/Frameworks building '_imaging' extension /usr/local/gnu/bin/gcc -fno-strict-aliasing -Wno-long-double -no-cpp- precomp -mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes - DHAVE_LIBJPEG -DHAVE_LIBZ -DWORDS_BIGENDIAN -I/System/Library/ Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/ Tk.framework/Headers -IlibImaging -I/sw/include -I/usr/stsci/pyssg/ Python-2.3.3/include -I/usr/local/include -I/usr/include -I/usr/stsci/ pyssg/Python-2.3.3/include/python2.3 -c libImaging/LzwDecode.c -o build/temp.darwin-8.7.0-Power_Macintosh-2.3/libImaging/LzwDecode.o unable to execute /usr/local/gnu/bin/gcc: No such file or directory error: command '/usr/local/gnu/bin/gcc' failed with exit status 1 I have tried aliasing this (/usr/local/gnu/) to my normal gcc (/usr/ local/gcc4.0/), but other problems arise: > python setup.py install running install running build running build_py running build_ext --- using frameworks at /System/Library/Frameworks building '_imaging' extension /usr/local/gnu/bin/gcc -fno-strict-aliasing -Wno-long-double -no-cpp- precomp -mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes - DHAVE_LIBJPEG -DHAVE_LIBZ -DWORDS_BIGENDIAN -I/System/Library/ Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/ Tk.framework/Headers -IlibImaging -I/sw/include -I/usr/stsci/pyssg/ Python-2.3.3/include -I/usr/local/include -I/usr/include -I/usr/stsci/ pyssg/Python-2.3.3/include/python2.3 -c libImaging/LzwDecode.c -o build/temp.darwin-8.7.0-Power_Macintosh-2.3/libImaging/LzwDecode.o powerpc-apple-darwin8-gcc-4.0.3: unrecognized option '-no-cpp-precomp' cc1: error: unrecognized command line option "-Wno-long-double" error: command '/usr/local/gnu/bin/gcc' failed with exit status 1 I cannot find any mention of a gcc path in the setup script so am unsure where this reference to usr/local/gnu/bin/gcc is coming from! I assume that this is a Framework problem, but am unsure how to deal with that. Finally - I also tried using the Mac installer from darwinports, but after running it I am still unable to "import Images" within python. I'd be most grateful for any help, David =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- David Floyd Tel: +1 410 338 4354 Space Telescope Science Institute Fax: +1 410 338 5075 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= From bozongo at gmx.de Tue Sep 5 10:05:43 2006 From: bozongo at gmx.de (Michael) Date: Tue, 05 Sep 2006 10:05:43 +0200 Subject: [Image-SIG] Here's a better flood-fill technique In-Reply-To: References: <200509172253.j8HMrtrs018277@snark.thyrsus.com> Message-ID: Hi, has this been integrated in the 1.1.6 beta1 yet? I can't find it, but maybe I'm looking in the wrong places. Thanks, michael Fredrik Lundh wrote: > Eric S. Raymond wrote: >> Frederik, say the word and I'll ship you a generalized version for PIL. > > no need; this looks like a nice addition to 1.1.6, and I can take it from > here... From jwt at onjapan.net Tue Sep 5 14:26:09 2006 From: jwt at onjapan.net (Jim Tittsler) Date: Tue, 05 Sep 2006 21:26:09 +0900 Subject: [Image-SIG] (no subject) In-Reply-To: <2E665A3C-61C9-4303-8CD8-EDD5BFC8C5B6@stsci.edu> References: <2E665A3C-61C9-4303-8CD8-EDD5BFC8C5B6@stsci.edu> Message-ID: <44FD6CE1.6010809@onjapan.net> On 2006-09-05 0:25, David Floyd wrote: > I am having little difficulty installing Python Imaging Library 1.1.5 > Source Kit on my Mac Powerbook G4 (under MacOS 10.4). If you are using the Universal Python 2.4.3, the easiest way to install PIL is just fetch the pre-built package from: http://pythonmac.org/packages/py24-fat/index.html -- Jim Tittsler http://www.OnJapan.net/ GPG: 0x01159DB6 Python Starship http://Starship.Python.net/crew/jwt/ Mailman IRC irc://irc.freenode.net/#mailman From skip at pobox.com Wed Sep 6 04:19:11 2006 From: skip at pobox.com (skip at pobox.com) Date: Tue, 5 Sep 2006 21:19:11 -0500 Subject: [Image-SIG] Saving multi-frame images with palette Message-ID: <17662.12319.18860.921755@montanaro.dyndns.org> I'm new here, using PIL (1.1.5) to do some front-end image manipulation for SpamBayes' nascent OCR capability. One of the tricks the spammers use now is multi-frame GIFs where most/all of the text is on some frame other than the first one. Here's an example: http://orca.mojam.com/~skip/bogus-0.gif I'm hoping to poke around a bit in the image using PIL to decide which frame to analyze (in theory I could run OCR on all frames, but it's an expensive enough operation already) and also to save the frame I select. The above image presents a problem though. Using this code: >>> img = Image.open("bogus-0.gif") >>> for frame in ImageSequence.Iterator(img): ... frame.show() the first frame is displayed using the image's palette. The rest are displayed in black-and-white. I suspect there's something fishy about this particular image. I have another one that show()s just fine, and this one displays properly in Firefox, so at some level it must be okay. Any suggestions? Thanks, -- Skip Montanaro - skip at pobox.com - http://www.mojam.com/ "In China today, Bill Gates is Britney Spears. In America today, Britney Spears is Britney Spears - and that is our problem." Thomas L. Friedman in "The World is Flat" From rthreet at usi.edu Thu Sep 7 18:39:56 2006 From: rthreet at usi.edu (Robert Threet) Date: Thu, 07 Sep 2006 11:39:56 -0500 Subject: [Image-SIG] Zope, Poll and PIL In-Reply-To: <1157647125.5329.3.camel@rthreet.usi.edu> References: <1157647125.5329.3.camel@rthreet.usi.edu> Message-ID: <1157647196.5329.5.camel@rthreet.usi.edu> "Curveball" - I think I had to retro the Python back to 2.3. 2.4 was installed . I modified both instances for PIL, however. On Thu, 2006-09-07 at 11:38 -0500, Robert Threet wrote: > I'm not able to get the pie charts top work. I am running Zope 2.7 and > Python 2.3 or 2.4 under Slackware 10. When you try to view the images > by itself the error is: > > Zope has encountered a problem publishing your object. > > The object at > http://linux.usi.edu:8080/LUG/AlchemyMagic/question13/drawGraph > has an empty or missing docstring. Objects must have a docstring > to be published. > > Got any tips? > http://linux.usi.edu:8080/LUG/AlchemyMagic > > -- Robert Threet Systems Manager - Computer Center University of Southern Indiana (812) 465-1070 x1082 From rthreet at usi.edu Thu Sep 7 18:38:45 2006 From: rthreet at usi.edu (Robert Threet) Date: Thu, 07 Sep 2006 11:38:45 -0500 Subject: [Image-SIG] Zope, Poll and PIL Message-ID: <1157647125.5329.3.camel@rthreet.usi.edu> I'm not able to get the pie charts top work. I am running Zope 2.7 and Python 2.3 or 2.4 under Slackware 10. When you try to view the images by itself the error is: Zope has encountered a problem publishing your object. The object at http://linux.usi.edu:8080/LUG/AlchemyMagic/question13/drawGraph has an empty or missing docstring. Objects must have a docstring to be published. Got any tips? http://linux.usi.edu:8080/LUG/AlchemyMagic -- Robert Threet Systems Manager - Computer Center University of Southern Indiana (812) 465-1070 x1082 From mikeal at osafoundation.org Thu Sep 7 23:09:49 2006 From: mikeal at osafoundation.org (Mikeal Rogers) Date: Thu, 7 Sep 2006 14:09:49 -0700 Subject: [Image-SIG] Bug Report/Patch :: Darwin support assumes fink -- no darwin-ports support Message-ID: <33DAAFEB-C75D-418D-9CFC-4F9D81E414FD@osafoundation.org> I ran into an issue installing PIL on darwin because I had used the darwin ports collection to get freetype2 and libjpeg. Diff attached for setup.py -------------- next part -------------- A non-text attachment was scrubbed... Name: pil_darwinports_patch Type: application/octet-stream Size: 298 bytes Desc: not available Url : http://mail.python.org/pipermail/image-sig/attachments/20060907/011cbc91/attachment.obj -------------- next part -------------- -Mikeal From text2babu at yahoo.co.in Fri Sep 8 07:29:42 2006 From: text2babu at yahoo.co.in (narendra babu) Date: Fri, 8 Sep 2006 06:29:42 +0100 (BST) Subject: [Image-SIG] data in EPS Message-ID: <20060908052942.39172.qmail@web8504.mail.in.yahoo.com> hello everybody, can i know where in the EPS file will we have the image data, the size of the data, so that i can extract the data for further processing. if the EPS file is created by Photoshop, will the image data be after Begin Photoshop line. and if the EPS file does not contain Begin photoshop then what tag should i search for the image data within the EPS, because i saw there is begin data and begin binary, which is the image data now, and how is it represented..... please reply to this message immediately, i should finish this project within a week. awaiting your replies...... narendra --------------------------------- Find out what India is talking about on - Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060908/f0653dcb/attachment.htm From text2babu at yahoo.co.in Fri Sep 8 11:06:56 2006 From: text2babu at yahoo.co.in (narendra babu) Date: Fri, 8 Sep 2006 10:06:56 +0100 (BST) Subject: [Image-SIG] information about image data in EPS file Message-ID: <20060908090656.47043.qmail@web8510.mail.in.yahoo.com> hello everybody, i must extract the image data from the EPS file, can anybody tell me after which comment does the image data starts. awaiting your reply narendra --------------------------------- Find out what India is talking about on - Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060908/a591049a/attachment.html From adeuring at gmx.net Sat Sep 9 13:46:39 2006 From: adeuring at gmx.net (abel deuring) Date: Sat, 09 Sep 2006 13:46:39 +0200 Subject: [Image-SIG] data in EPS In-Reply-To: <20060908052942.39172.qmail@web8504.mail.in.yahoo.com> References: <20060908052942.39172.qmail@web8504.mail.in.yahoo.com> Message-ID: <4502A99F.9070008@gmx.net> Narendra, > can i know where in the EPS file will we have the image data, the size > of the data, so that i can extract the data for further processing. You can find the EPS specification at http://partners.adobe.com/public/developer/ps/index_specs.html . You'll find also the Postscript reference on this page. > if the EPS file is created by Photoshop, will the image data be after > Begin Photoshop line. Probably ;) But to be honest, I don't know any details about Photoshop EPS files. Perhaps you can find something on the Adobe website. > and if the EPS file does not contain Begin photoshop then what tag > should i search for the image data within the EPS, because i saw there > is begin data and begin binary, which is the image data now, and how is > it represented..... > > > please reply to this message immediately, i should finish this project > within a week. Well, the simplest thing is to use PIL's EPS plugin ;) If you cannot or don't want to use the plugin: Good luck. While it should be possible to parse Photoshop EPS files in order to find and read the pixel data, once you have found the necessary information about Photoshop EPS files, an arbitrary EPS file is a different matter. Postscript is a programming language, hence you need a Postscript interpreter, if you want process arbitrary EPS files. And this is exactly, what PIL's EpsImagePlugin.py uses: Ghostscript. Abel From skip at pobox.com Sat Sep 9 23:31:34 2006 From: skip at pobox.com (skip at pobox.com) Date: Sat, 9 Sep 2006 16:31:34 -0500 Subject: [Image-SIG] Distinguish single-frame from multi-frame GIF images? Message-ID: <17667.12982.131346.344856@montanaro.dyndns.org> Is there a way to determine I'm dealing with a single-frame vs. multi-frame GIF image without actually trying to seek? For example, will the duration key in the info dict always be present in multi-frame images (and never be present in single-frame images)? Thanks, -- Skip Montanaro - skip at pobox.com - http://www.mojam.com/ "In China today, Bill Gates is Britney Spears. In America today, Britney Spears is Britney Spears - and that is our problem." Thomas L. Friedman in "The World is Flat" From fredrik at pythonware.com Mon Sep 11 19:58:24 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 11 Sep 2006 19:58:24 +0200 Subject: [Image-SIG] Distinguish single-frame from multi-frame GIF images? In-Reply-To: <17667.12982.131346.344856@montanaro.dyndns.org> References: <17667.12982.131346.344856@montanaro.dyndns.org> Message-ID: skip at pobox.com wrote: > Is there a way to determine I'm dealing with a single-frame vs. multi-frame > GIF image without actually trying to seek? For example, will the duration > key in the info dict always be present in multi-frame images (and never be > present in single-frame images)? not sure; the duration value and the frames are in different blocks, so it's perfectly possible to create a GIF that has multiple frames but no information block. not sure if it's valid, though; you'll have to check the specification for details. From radbou at ipexinc.com Tue Sep 12 21:05:29 2006 From: radbou at ipexinc.com (Bouzite, Radouan) Date: Tue, 12 Sep 2006 15:05:29 -0400 Subject: [Image-SIG] Converting to zebra (ZPL) format Message-ID: <6F3EC091FE756F42BE189BA64226A5FC0190DFB3@mail1ids.ipex.network> I am looking for the python script to convert pcx to zpl ? ------------------------------------------------------------ Radouan Bouzite Unix Admin. IPEX Inc. radbou at ipexinc.com Tel: (514) 769-2200, ext. 291 Fax: (514) 769-1672 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060912/e8356cc6/attachment.htm From radbou at ipexinc.com Thu Sep 14 14:39:42 2006 From: radbou at ipexinc.com (Bouzite, Radouan) Date: Thu, 14 Sep 2006 08:39:42 -0400 Subject: [Image-SIG] pcx to zpl Message-ID: <6F3EC091FE756F42BE189BA64226A5FC0190DFC1@mail1ids.ipex.network> I am looking for python script to convert pcx to zpl !! ------------------------------------------------------------ Radouan Bouzite Unix Admin. IPEX Inc. radbou at ipexinc.com Tel: (514) 769-2200, ext. 291 Fax: (514) 769-1672 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060914/a54b8bc6/attachment.html From izakmarais at yahoo.com Fri Sep 15 14:05:26 2006 From: izakmarais at yahoo.com (izak marais) Date: Fri, 15 Sep 2006 05:05:26 -0700 (PDT) Subject: [Image-SIG] Custom filter Message-ID: <20060915120526.66277.qmail@web50908.mail.yahoo.com> Hello Is there a way to define a custom filter instead of using the predefined options in ImageFiler? I'd like to be able to give the 2d coefficients as a numpy array, but whatever the format should be, an explenation would be much appreciated. Just by looking at the ImageFilter help, it seems like it should be possible by calling filter() or Kernel(), but I can't deduce the necessary arguments and their formats. Also, is there any easy way to search through the mail archives? As far as I can see there's no search option at http://mail.python.org/pipermail/image-sig/. Thanks Izak --------------------------------- Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2?/min or less. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060915/42cbc908/attachment.htm From fredrik at pythonware.com Tue Sep 19 12:59:01 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue, 19 Sep 2006 12:59:01 +0200 Subject: [Image-SIG] Custom filter References: <20060915120526.66277.qmail@web50908.mail.yahoo.com> Message-ID: "izak marais" wrote in message > Is there a way to define a custom filter instead of using the predefined > options in ImageFiler? I'd like to be able to give the 2d coefficients as > a numpy array, but whatever the format should be, an explenation > would be much appreciated. Just by looking at the ImageFilter help, > it seems like it should be possible by calling filter() or Kernel(), but > I can't deduce the necessary arguments and their formats. the Kernel class is described in the on-line reference: http://effbot.org/imagingbook/imagefilter.htm it simply expects a flattened list of 9 or 25 items, so you should be able to use kernel.flat or kernel.flatten() or kernel.flatten(1) or what- ever it's called in the current numpy version... > Also, is there any easy way to search through the mail archives? As > far as I can see there's no search option at > http://mail.python.org/pipermail/image-sig/. this URL lets you search the mailing list archives: http://www.python.org/search/ I prefer the gmane search engine, but that one seems to be down right now... http://www.gmane.org/ (the image-sig list is called gmane.comp.python.image over there) From fredrik at pythonware.com Tue Sep 19 13:00:59 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue, 19 Sep 2006 13:00:59 +0200 Subject: [Image-SIG] Converting to zebra (ZPL) format References: <6F3EC091FE756F42BE189BA64226A5FC0190DFB3@mail1ids.ipex.network> Message-ID: "Bouzite, Radouan" wrote: > I am looking for the python script to convert pcx to zpl ? I'm not aware of any such script, and I don't have any idea what ZPL (or Zebra) is. Is this something you've seen somewhere, and need help locating, or are you just asking if it exists? From dima.osin at weizmann.ac.il Wed Sep 20 14:01:10 2006 From: dima.osin at weizmann.ac.il (dima osin) Date: Wed, 20 Sep 2006 15:01:10 +0300 Subject: [Image-SIG] how to work with 16 bit tiff using PIL Message-ID: <45112D86.9040604@weizmann.ac.il> Good Day At work I mostly use 16 bit TIFF images saved by CCD cameras or from scanned films. I started using Python and it seems that I cannot operate with 16 bit TIFF images using PIL off the box. I'm new to Python, so may be I do something wrong. If it is possible to operate with 16 bit tiff using the recent 1.1.5 PIL, please, advice me. I will be very grateful for your help. Thank you in advance. -- Dima Osin Weizmann Institute of Science From stef.henry at gmail.com Wed Sep 20 15:13:08 2006 From: stef.henry at gmail.com (Stephane Henry) Date: Wed, 20 Sep 2006 14:13:08 +0100 Subject: [Image-SIG] PIL - numpy Message-ID: <18b571dd0609200613s1cbf4888uc1af3267e842e59c@mail.gmail.com> Hello everybody - bonjour tout le monde do u have an idea why this code (from http://effbot.org/zone/pil-changes-116.htm) doesn't work on my newly upgraded machine? import numpy, Image i = Image.open('lena.jpg') a = numpy.asarray(i) # a is readonly i = Image.fromarray(a) The versions seem OK : >>> numpy.__version__ '1.0b5' >>> Image.VERSION '1.1.6a0' sorry if that was allready discussed but I can't figure out how to find something in the archives. Cheers From fredrik at pythonware.com Wed Sep 20 16:01:15 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 20 Sep 2006 16:01:15 +0200 Subject: [Image-SIG] PIL - numpy In-Reply-To: <18b571dd0609200613s1cbf4888uc1af3267e842e59c@mail.gmail.com> References: <18b571dd0609200613s1cbf4888uc1af3267e842e59c@mail.gmail.com> Message-ID: Stephane Henry wrote: > The versions seem OK : >>>> numpy.__version__ > '1.0b5' >>>> Image.VERSION > '1.1.6a0' did you look for 1.1.6a0 on the changes page ? From stef.henry at gmail.com Wed Sep 20 16:20:15 2006 From: stef.henry at gmail.com (Stephane Henry) Date: Wed, 20 Sep 2006 15:20:15 +0100 Subject: [Image-SIG] PIL - numpy In-Reply-To: <18b571dd0609200613s1cbf4888uc1af3267e842e59c@mail.gmail.com> References: <18b571dd0609200613s1cbf4888uc1af3267e842e59c@mail.gmail.com> Message-ID: <18b571dd0609200720x35698f2bwff41da51b3304019@mail.gmail.com> Hi I figured out that some lines (that are given in the archive) have to be added to Image.py for using numpy.asarray(PILimage). I thought those lines where added to the PIL 1.1.6. , they might just have been for one time. Then it works fine (with just converting one time my image (mode 'I' for example) because it's a TIFF16). by the way, there are several pil-related functions in scipy.misc(thanks to Ren): ? fromimage ? convert a PIL image to a Numeric array ? toimage ? convert Numeric array to PIL image ? imsave ? save Numeric array to an image file ? imread ? read an image file into a Numeric array ? imrotate ? rotate an image (a Numeric array) counter-clockwise ? imresize ? resize an image using the PIL ? imshow ? external viewer of a Numeric array (using PIL) ? imfilter ? fast, simple built-in filters provided by PIL ? radon ? simple radon transform based on imrotate From Pierre.Barbier_de_Reuille at inria.fr Wed Sep 20 21:33:25 2006 From: Pierre.Barbier_de_Reuille at inria.fr (Pierre Barbier de Reuille) Date: Wed, 20 Sep 2006 13:33:25 -0600 Subject: [Image-SIG] how to work with 16 bit tiff using PIL In-Reply-To: <45112D86.9040604@weizmann.ac.il> References: <45112D86.9040604@weizmann.ac.il> Message-ID: <45119785.7020108@inria.fr> dima osin a ?crit : > Good Day > > At work I mostly use 16 bit TIFF images saved by CCD cameras or from scanned films. I > started using Python and it seems that I cannot operate with 16 bit TIFF images using > PIL off the box. I'm new to Python, so may be I do something wrong. If it is possible > to operate with 16 bit tiff using the recent 1.1.5 PIL, please, advice me. I will be > very grateful for your help. > Thank you in advance. > It is definitely possible, as I am doing it :) What do you want to do that is not working ? Pierre From Chris.Barker at noaa.gov Thu Sep 21 01:23:37 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 20 Sep 2006 16:23:37 -0700 Subject: [Image-SIG] PIL - numpy In-Reply-To: References: <18b571dd0609200613s1cbf4888uc1af3267e842e59c@mail.gmail.com> Message-ID: <4511CD79.8010203@noaa.gov> Fredrik Lundh wrote: > Stephane Henry wrote: > >> The versions seem OK : >>>>> numpy.__version__ >> '1.0b5' >>>>> Image.VERSION >> '1.1.6a0' > > did you look for 1.1.6a0 on the changes page ? looking there, the numpy additions are listed in the most recent, "not released" section. Is there a way to get that code and/or when do you expect to release the next 1.1.6 beta? it would be good to have this tested as numpy approached it's 1.0 release. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From wulabs at gmail.com Fri Sep 22 03:12:20 2006 From: wulabs at gmail.com (Jack Wu) Date: Thu, 21 Sep 2006 18:12:20 -0700 Subject: [Image-SIG] Problem with jpeg decoder and PIL Message-ID: <234081550609211812q41d23673y699666cfe943033a@mail.gmail.com> Hi I'm specifically having problems with the JPEG support on OSX 10.3 PPC. I got Fink to install jpeglib I ran PIL's setup.py with the automatic paths i.e. '*ROOT = None' (should automatically use '/sw' due to fink) ----------------------------- running install running build running build_py running build_ext -------------------------------------------------------------------- PIL 1.1.5 BUILD SUMMARY -------------------------------------------------------------------- version 1.1.5 platform darwin 2.4.1 (#2, Mar 31 2005, 00:05:10) [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] -------------------------------------------------------------------- *** TKINTER support not available --- JPEG support ok --- ZLIB (PNG/ZIP) support ok *** FREETYPE2 support not available -------------------------------------------------------------------- To add a missing option, make sure you have the required library, and set the corresponding ROOT variable in the setup.py script. To check the build, run the selftest.py script. running build_scripts running install_lib running install_scripts changing mode of /Library/Frameworks/Python.framework/Versions/2.4/bin/pilconvert.py to 755 changing mode of /Library/Frameworks/Python.framework/Versions/2.4/bin/pildriver.py to 755 changing mode of /Library/Frameworks/Python.framework/Versions/2.4/bin/pilfile.py to 755 changing mode of /Library/Frameworks/Python.framework/Versions/2.4/bin/pilfont.py to 755 changing mode of /Library/Frameworks/Python.framework/Versions/2.4/bin/pilprint.py to 755 creating /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packag es/PIL.pth ------------------- Ok, but then i ran the self test and apparenlty doesn't work: python selftest.py ***************************************************************** Failure in example: _info(Image.open("Images/lena.jpg")) from line #24 of selftest.testimage Exception raised: Traceback (most recent call last): File "./doctest.py", line 499, in _run_examples_inner exec compile(source, "", "single") in globs File "", line 1, in ? File "./selftest.py", line 21, in _info im.load() File "PIL/ImageFile.py", line 180, in load d = Image._getdecoder(self.mode, d, a, self.decoderconfig) File "PIL/Image.py", line 328, in _getdecoder raise IOError("decoder %s not available" % decoder_name) IOError: decoder jpeg not available 1 items had failures: 1 of 55 in selftest.testimage ***Test Failed*** 1 failures. *** 1 tests of 55 failed. I also tried building the jpegLib (successfull) and adding that path ('/usr/local/lib') to the JPEGROOT = "" line in the setup.py, and resetup PIL. This has same results as above. From wulabs at gmail.com Fri Sep 22 08:54:44 2006 From: wulabs at gmail.com (Jack Wu) Date: Thu, 21 Sep 2006 23:54:44 -0700 Subject: [Image-SIG] Need help installing PIL 1.1.5 on OSX (LONG) Message-ID: <234081550609212354iee3973bje06245bf26f2e027@mail.gmail.com> Hi I've spent a good majority of my day trying to figure out how to have PIL 1.1.5 working on my OSX 10.3.9_PPC machine. I'm still stuck and I have not gotten anywhere. Could somebody please help me... I've scoured all the documentation, google, and mailing lists to no avail. I believe the problem may lay in a jpeglib problem with OSX 10.3.9, or a python paths problem. Here is info on my system (note this is not the default Python version that comes with OSX): Python 2.4.1 (#2, Mar 31 2005, 00:05:10) [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin This email is really long, I've seperated the sections with 3-4 lines of spacing. Here is my own PIL installation summary, I followed directions in README. I am using the most recent install package from the PIL website. I also tried using the default JPEG_ROOT=None and JPEG_ROOT = "sw/lib", where I was able to locate the jpeglib files. --------------------------------------------------------------------------------------- running install running build running build_py running build_ext -------------------------------------------------------------------- PIL 1.1.5 BUILD SUMMARY -------------------------------------------------------------------- version 1.1.5 platform darwin 2.4.1 (#2, Mar 31 2005, 00:05:10) [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] -------------------------------------------------------------------- *** TKINTER support not available --- JPEG support ok --- ZLIB (PNG/ZIP) support ok *** FREETYPE2 support not available -------------------------------------------------------------------- To add a missing option, make sure you have the required library, and set the corresponding ROOT variable in the setup.py script. To check the build, run the selftest.py script. running build_scripts running install_lib running install_scripts changing mode of /Library/Frameworks/Python.framework/Versions/2.4/bin/pilconvert.py to 755 changing mode of /Library/Frameworks/Python.framework/Versions/2.4/bin/pildriver.py to 755 changing mode of /Library/Frameworks/Python.framework/Versions/2.4/bin/pilfile.py to 755 changing mode of /Library/Frameworks/Python.framework/Versions/2.4/bin/pilfont.py to 755 changing mode of /Library/Frameworks/Python.framework/Versions/2.4/bin/pilprint.py to 755 creating /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packag es/PIL.pth --------------------------------------------------------------------------------------- This file was 212KB. I tried running the self-test and this is my output: ***************************************************************** Failure in example: _info(Image.open("Images/lena.jpg")) from line #24 of selftest.testimage Exception raised: Traceback (most recent call last): File "./doctest.py", line 499, in _run_examples_inner exec compile(source, "", "single") in globs File "", line 1, in ? File "./selftest.py", line 21, in _info im.load() File "PIL/ImageFile.py", line 180, in load d = Image._getdecoder(self.mode, d, a, self.decoderconfig) File "PIL/Image.py", line 328, in _getdecoder raise IOError("decoder %s not available" % decoder_name) IOError: decoder jpeg not available 1 items had failures: 1 of 55 in selftest.testimage ***Test Failed*** 1 failures. *** 1 tests of 55 failed. I ran "$python -vv -c "import _imaging"" and this was the important output: ------------------------------------------------------------------------ import _imaging # dynamically loaded from /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PIL/_imaging.so ------------------------------------------------------------------------ This file was 962KB. The _imaging.so file mentioned above (962KB) was not actually the same one that I compiled earlier (212KB). So I figured there must be some problem with my python path. I copied the newly compiled version into the python PIL directory above and tried again. Same problem on self test. I then tried the Darwin ports py-pil (http://py-pil.darwinports.com/). This is the output that I got when installing: ------------------------------------------------------------------------ sudo port install py-pil ---> Fetching freetype ---> Attempting to fetch freetype-2.1.10.tar.bz2 from http://download.savannah.gnu.org/releases/freetype/ ---> Verifying checksum(s) for freetype ---> Extracting freetype ---> Applying patches to freetype ---> Configuring freetype ---> Building freetype with target all ---> Staging freetype into destroot ---> Packaging tgz archive for freetype 2.1.10_1 ---> Installing freetype 2.1.10_1 ---> Activating freetype 2.1.10_1 ---> Cleaning freetype ---> Fetching jpeg ---> Attempting to fetch jpegsrc.v6b.tar.gz from http://www.ijg.org/files ---> Verifying checksum(s) for jpeg ---> Extracting jpeg ---> Applying patches to jpeg ---> Configuring jpeg ---> Building jpeg with target all ---> Staging jpeg into destroot ---> Packaging tgz archive for jpeg 6b_1 ---> Installing jpeg 6b_1 ---> Activating jpeg 6b_1 ---> Cleaning jpeg ---> Fetching py-pil ---> Attempting to fetch Imaging-1.1.5.tar.gz from http://effbot.org/downloads/ ---> Verifying checksum(s) for py-pil ---> Extracting py-pil ---> Applying patches to py-pil ---> Configuring py-pil ---> Building py-pil with target build ---> Staging py-pil into destroot ---> Packaging tgz archive for py-pil 1.1.5_1 ---> Installing py-pil 1.1.5_1 ---> Activating py-pil 1.1.5_1 ---> Cleaning py-pil ------------------------------------------------------------------------ This created a _imaging.so file which was 684KB. I copied this newly created _imaging.so file into my appropriate python PIL directory and ran self-test again, and it still had the same error. Another test I did was to remove _imaging.so completely from the PIL directory in Python. When I ran (python -vv -c "import _imaging"), this was the output: ------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ? ImportError: No module named _imaging ------------------------------------------------------------------------ But self_test.py still had the same output as before (JPEG decode error). I also downloaded jpeglib(jpeg-6b) and built it myself (succesfully), and passed the lib directory for JPEG_ROOT in the PIL installer, but that didn't have any different self-test results. It is also very strange that i can set the JPEG_ROOT to be anything, even something ficticious and the installer will report 'no support errors' for JPEG. Another strange thing is a discprency in JPEG libraries, py-pil seems to use JPEG while PIL seems to reference only LIBJPEG. Running a search on my HD for _imaging.so turns up 4 sources: 1) /opt/local/lib/python2.4/site-package/PIL/_imaging.so (684KB - this was generated by the py-pil install) 2) /opt/local/var/db/dports/software/py-pil/1.1.5_1/opt/lcoal/lib/python2.4/site-packages/PIL/_imagin.so (684KB - this was generated by the py-pil install) 3) Desktop/Imaging-1.1.5/PIL/_imaging.so (212KB - this was generated by the PIL Imaging isntall) 4) Desktop/Imaging-1.1.5/build/lib.darwin-7.9.0-Power_macintosh-2.4/_imaging.so (212KB - this was generated by the PIL Imaging install) My goal is to get the self-test working properly. Somebody please help! -- Jack Wu -- Jack Wu From fredrik at pythonware.com Fri Sep 22 09:06:50 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 22 Sep 2006 09:06:50 +0200 Subject: [Image-SIG] Need help installing PIL 1.1.5 on OSX (LONG) In-Reply-To: <234081550609212354iee3973bje06245bf26f2e027@mail.gmail.com> References: <234081550609212354iee3973bje06245bf26f2e027@mail.gmail.com> Message-ID: Jack Wu wrote: > I've spent a good majority of my day trying to figure out how to have > PIL 1.1.5 working on my OSX 10.3.9_PPC machine. I'm still stuck and I > have not gotten anywhere. Could somebody please help me... any reason you cannot use the prebuilt version ? http://pythonmac.org/packages/py24-fat/index.html From Chris.Barker at noaa.gov Fri Sep 22 18:41:32 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 22 Sep 2006 09:41:32 -0700 Subject: [Image-SIG] Need help installing PIL 1.1.5 on OSX (LONG) In-Reply-To: References: <234081550609212354iee3973bje06245bf26f2e027@mail.gmail.com> Message-ID: <4514123C.4080102@noaa.gov> Fredrik Lundh wrote: > any reason you cannot use the prebuilt version ? > > http://pythonmac.org/packages/py24-fat/index.html or, if you don't want to upgrade python: http://www.pythonmac.org/packages/legacy.html -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From bob at redivi.com Fri Sep 22 18:55:30 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 22 Sep 2006 09:55:30 -0700 Subject: [Image-SIG] Need help installing PIL 1.1.5 on OSX (LONG) In-Reply-To: <4514123C.4080102@noaa.gov> References: <234081550609212354iee3973bje06245bf26f2e027@mail.gmail.com> <4514123C.4080102@noaa.gov> Message-ID: <6a36e7290609220955y3e5e7277pf2633c35f8dc4db8@mail.gmail.com> On 9/22/06, Christopher Barker wrote: > Fredrik Lundh wrote: > > any reason you cannot use the prebuilt version ? > > > > http://pythonmac.org/packages/py24-fat/index.html > > or, if you don't want to upgrade python: > > http://www.pythonmac.org/packages/legacy.html You don't have to, he said he was using 2.4.1, which can still use universal extensions built for 2.4.3. -bob From wulabs at gmail.com Fri Sep 22 19:21:29 2006 From: wulabs at gmail.com (Jack Wu) Date: Fri, 22 Sep 2006 10:21:29 -0700 Subject: [Image-SIG] Need help installing PIL 1.1.5 on OSX (LONG) In-Reply-To: <6a36e7290609220955y3e5e7277pf2633c35f8dc4db8@mail.gmail.com> References: <234081550609212354iee3973bje06245bf26f2e027@mail.gmail.com> <4514123C.4080102@noaa.gov> <6a36e7290609220955y3e5e7277pf2633c35f8dc4db8@mail.gmail.com> Message-ID: <234081550609221021v7f300712i5301b864d8877804@mail.gmail.com> Thanks for replying. Actually I also had tried that earlier, to no avail. Sorry i forgot to mention it in my long email. A note, the filename says OSX10.4, I have OSX10.3.9...but it didn't give me any errors while installing. Just for kicks I installed again right now, here is the process and the output: 1) install via GUI, everything went okay 2) python -vv -c "import imaging" returned this in the middle of output: import _imaging # dynamically loaded from /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PIL/_imaging.so 3) _imaging.so in main python dir was updated (previously was ~600KB): Jack-Wus-Computer:~ jackwu$ ls -la /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PIL/_imaging.so -rw--w---- 1 jackwu admin 931268 19 Apr 09:23 /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PIL/_imaging.so 4) self test still fails: Jack-Wus-Computer:~/Desktop/Imaging-1.1.5 jackwu$ python selftest.py ***************************************************************** Failure in example: _info(Image.open("Images/lena.jpg")) from line #24 of selftest.testimage Exception raised: Traceback (most recent call last): File "./doctest.py", line 499, in _run_examples_inner exec compile(source, "", "single") in globs File "", line 1, in ? File "./selftest.py", line 21, in _info im.load() File "PIL/ImageFile.py", line 180, in load d = Image._getdecoder(self.mode, d, a, self.decoderconfig) File "PIL/Image.py", line 328, in _getdecoder raise IOError("decoder %s not available" % decoder_name) IOError: decoder jpeg not available 1 items had failures: 1 of 55 in selftest.testimage ***Test Failed*** 1 failures. *** 1 tests of 55 failed. -Jack On 9/22/06, Bob Ippolito wrote: > On 9/22/06, Christopher Barker wrote: > > Fredrik Lundh wrote: > > > any reason you cannot use the prebuilt version ? > > > > > > http://pythonmac.org/packages/py24-fat/index.html > > > > or, if you don't want to upgrade python: > > > > http://www.pythonmac.org/packages/legacy.html > > You don't have to, he said he was using 2.4.1, which can still use > universal extensions built for 2.4.3. > > -bob > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > -- Jack Wu From bob at redivi.com Fri Sep 22 19:54:45 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 22 Sep 2006 10:54:45 -0700 Subject: [Image-SIG] Need help installing PIL 1.1.5 on OSX (LONG) In-Reply-To: <234081550609221021v7f300712i5301b864d8877804@mail.gmail.com> References: <234081550609212354iee3973bje06245bf26f2e027@mail.gmail.com> <4514123C.4080102@noaa.gov> <6a36e7290609220955y3e5e7277pf2633c35f8dc4db8@mail.gmail.com> <234081550609221021v7f300712i5301b864d8877804@mail.gmail.com> Message-ID: <6a36e7290609221054y70be1997qbc412944f00b282a@mail.gmail.com> On 9/22/06, Jack Wu wrote: > Fedrick yesterday.> > > Thanks for replying. > > Actually I also had tried that earlier, to no avail. Sorry i forgot > to mention it in my long email. A note, the filename says OSX10.4, I > have OSX10.3.9...but it didn't give me any errors while installing. The page says 10.3.9 or later. The filenames say 10.4 because that's what they were built with. You can't build universal binaries with 10.3. > Just for kicks I installed again right now, here is the process and the output: > 1) install via GUI, everything went okay > > 2) python -vv -c "import imaging" returned this in the middle of output: > import _imaging # dynamically loaded from > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PIL/_imaging.so > > 3) _imaging.so in main python dir was updated (previously was ~600KB): > Jack-Wus-Computer:~ jackwu$ ls -la > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PIL/_imaging.so > -rw--w---- 1 jackwu admin 931268 19 Apr 09:23 > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PIL/_imaging.so Which one did you install? -rw--w---- 1 bob admin 1770444 Apr 19 09:23 /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PIL/_imaging.so > 4) self test still fails: > Jack-Wus-Computer:~/Desktop/Imaging-1.1.5 jackwu$ python selftest.py > ***************************************************************** > Failure in example: _info(Image.open("Images/lena.jpg")) > from line #24 of selftest.testimage > Exception raised: This leads me to believe that you're not loading the installed PIL when running this selftest.py. The PIL on that page definitely works fine, and it's got nothing to do with 10.3.9. You should try actually using it. -bob From wulabs at gmail.com Fri Sep 22 20:18:21 2006 From: wulabs at gmail.com (Jack Wu) Date: Fri, 22 Sep 2006 11:18:21 -0700 Subject: [Image-SIG] Need help installing PIL 1.1.5 on OSX (LONG) In-Reply-To: <6a36e7290609221054y70be1997qbc412944f00b282a@mail.gmail.com> References: <234081550609212354iee3973bje06245bf26f2e027@mail.gmail.com> <4514123C.4080102@noaa.gov> <6a36e7290609220955y3e5e7277pf2633c35f8dc4db8@mail.gmail.com> <234081550609221021v7f300712i5301b864d8877804@mail.gmail.com> <6a36e7290609221054y70be1997qbc412944f00b282a@mail.gmail.com> Message-ID: <234081550609221118w4706e908ke803fb0ffad92db3@mail.gmail.com> Hi Bob, I used this package: PIL-1.1.5-py2.4-macosx10.4.zip It was an OSX GUI installer, which completed successfully. "This leads me to believe that you're not loading the installed PIL when running this selftest.py. The PIL on that page definitely works fine, and it's got nothing to do with 10.3.9. You should try actually using it." -Ok, I installed it already....hence my previous email where I stated that the _imaging.so package in my main Python directory changed sizes to 931KB. Are you suggesting I run self-test.py from inside the "PIL-1.1.5-py2.4-macosx10.4.zip" package? What directory would that be in, as all I see is a single package file, and it doesn't give any documentation as to where it installed PIL? "-rw--w---- 1 bob admin 1770444 Apr 19 09:23" What file is this? Is my _imaging.so supposed to be 1770KB? Thanks for the help, -Jack On 9/22/06, Bob Ippolito wrote: > On 9/22/06, Jack Wu wrote: > > > Fedrick yesterday.> > > > > Thanks for replying. > > > > Actually I also had tried that earlier, to no avail. Sorry i forgot > > to mention it in my long email. A note, the filename says OSX10.4, I > > have OSX10.3.9...but it didn't give me any errors while installing. > > The page says 10.3.9 or later. The filenames say 10.4 because that's > what they were built with. You can't build universal binaries with > 10.3. > > > Just for kicks I installed again right now, here is the process and the output: > > 1) install via GUI, everything went okay > > > > 2) python -vv -c "import imaging" returned this in the middle of output: > > import _imaging # dynamically loaded from > > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PIL/_imaging.so > > > > 3) _imaging.so in main python dir was updated (previously was ~600KB): > > Jack-Wus-Computer:~ jackwu$ ls -la > > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PIL/_imaging.so > > -rw--w---- 1 jackwu admin 931268 19 Apr 09:23 > > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PIL/_imaging.so > > Which one did you install? > > -rw--w---- 1 bob admin 1770444 Apr 19 09:23 > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PIL/_imaging.so > > > 4) self test still fails: > > Jack-Wus-Computer:~/Desktop/Imaging-1.1.5 jackwu$ python selftest.py > > ***************************************************************** > > Failure in example: _info(Image.open("Images/lena.jpg")) > > from line #24 of selftest.testimage > > Exception raised: > > This leads me to believe that you're not loading the installed PIL > when running this selftest.py. The PIL on that page definitely works > fine, and it's got nothing to do with 10.3.9. You should try actually > using it. > > -bob > -- Jack Wu From bob at redivi.com Fri Sep 22 20:29:15 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 22 Sep 2006 11:29:15 -0700 Subject: [Image-SIG] Need help installing PIL 1.1.5 on OSX (LONG) In-Reply-To: <234081550609221118w4706e908ke803fb0ffad92db3@mail.gmail.com> References: <234081550609212354iee3973bje06245bf26f2e027@mail.gmail.com> <4514123C.4080102@noaa.gov> <6a36e7290609220955y3e5e7277pf2633c35f8dc4db8@mail.gmail.com> <234081550609221021v7f300712i5301b864d8877804@mail.gmail.com> <6a36e7290609221054y70be1997qbc412944f00b282a@mail.gmail.com> <234081550609221118w4706e908ke803fb0ffad92db3@mail.gmail.com> Message-ID: <6a36e7290609221129t10dd7676ob0c8731dcf068292@mail.gmail.com> On 9/22/06, Jack Wu wrote: > Hi Bob, > > I used this package: > PIL-1.1.5-py2.4-macosx10.4.zip > > It was an OSX GUI installer, which completed successfully. > > "This leads me to believe that you're not loading the installed PIL > when running this selftest.py. The PIL on that page definitely works > fine, and it's got nothing to do with 10.3.9. You should try actually > using it." > -Ok, I installed it already....hence my previous email where I stated > that the _imaging.so package in my main Python directory changed sizes > to 931KB. > Are you suggesting I run self-test.py from inside the > "PIL-1.1.5-py2.4-macosx10.4.zip" package? What directory would that > be in, as all I see is a single package file, and it doesn't give any > documentation as to where it installed PIL? It installs it to the site-packages directory. It actually will tell you exactly where it's going to put stuff if you click "customize" and read the descriptions for the component packages. There isn't a selftest installed. What I suggested was trying to actually use it. My guess is that something in your PIL source directory is getting imported instead of the installed verison, so the selftest there fails. If it still doesn't work, then install the legacy package, which was built and tested with the exact platform/python combination you're using. > "-rw--w---- 1 bob admin 1770444 Apr 19 09:23" > What file is this? Is my _imaging.so supposed to be 1770KB? Yes. Perhaps the installer in Mac OS X 10.3 does arch stripping though. -bob From wulabs at gmail.com Fri Sep 22 20:56:31 2006 From: wulabs at gmail.com (Jack Wu) Date: Fri, 22 Sep 2006 11:56:31 -0700 Subject: [Image-SIG] Need help installing PIL 1.1.5 on OSX (LONG) In-Reply-To: <6a36e7290609221129t10dd7676ob0c8731dcf068292@mail.gmail.com> References: <234081550609212354iee3973bje06245bf26f2e027@mail.gmail.com> <4514123C.4080102@noaa.gov> <6a36e7290609220955y3e5e7277pf2633c35f8dc4db8@mail.gmail.com> <234081550609221021v7f300712i5301b864d8877804@mail.gmail.com> <6a36e7290609221054y70be1997qbc412944f00b282a@mail.gmail.com> <234081550609221118w4706e908ke803fb0ffad92db3@mail.gmail.com> <6a36e7290609221129t10dd7676ob0c8731dcf068292@mail.gmail.com> Message-ID: <234081550609221156y2fd62f9cmb26a1fb20d4e3ae9@mail.gmail.com> Wow Bob, Good suggestion. The application I'm using is Engal on Turbogears, a prototype photosharing web app. The JPEG photos now load correctly. The Gif images do not, and I get a "IOError: cannot write mode P as JPEG", but I will leave that to another thread after I do some dissecting. So I guess I will remove all other PIL / LIBJPEG sources, install files, etc....and just rely on the package that seems to work. Thanks for the help guys! I appreciate it! -Jack On 9/22/06, Bob Ippolito wrote: > On 9/22/06, Jack Wu wrote: > > Hi Bob, > > > > I used this package: > > PIL-1.1.5-py2.4-macosx10.4.zip > > > > It was an OSX GUI installer, which completed successfully. > > > > "This leads me to believe that you're not loading the installed PIL > > when running this selftest.py. The PIL on that page definitely works > > fine, and it's got nothing to do with 10.3.9. You should try actually > > using it." > > -Ok, I installed it already....hence my previous email where I stated > > that the _imaging.so package in my main Python directory changed sizes > > to 931KB. > > Are you suggesting I run self-test.py from inside the > > "PIL-1.1.5-py2.4-macosx10.4.zip" package? What directory would that > > be in, as all I see is a single package file, and it doesn't give any > > documentation as to where it installed PIL? > > It installs it to the site-packages directory. It actually will tell > you exactly where it's going to put stuff if you click "customize" and > read the descriptions for the component packages. > > There isn't a selftest installed. What I suggested was trying to > actually use it. My guess is that something in your PIL source > directory is getting imported instead of the installed verison, so the > selftest there fails. > > If it still doesn't work, then install the legacy package, which was > built and tested with the exact platform/python combination you're > using. > > > "-rw--w---- 1 bob admin 1770444 Apr 19 09:23" > > What file is this? Is my _imaging.so supposed to be 1770KB? > > Yes. Perhaps the installer in Mac OS X 10.3 does arch stripping though. > > -bob > -- Jack Wu From bob at redivi.com Fri Sep 22 21:00:55 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 22 Sep 2006 12:00:55 -0700 Subject: [Image-SIG] Need help installing PIL 1.1.5 on OSX (LONG) In-Reply-To: <234081550609221156y2fd62f9cmb26a1fb20d4e3ae9@mail.gmail.com> References: <234081550609212354iee3973bje06245bf26f2e027@mail.gmail.com> <4514123C.4080102@noaa.gov> <6a36e7290609220955y3e5e7277pf2633c35f8dc4db8@mail.gmail.com> <234081550609221021v7f300712i5301b864d8877804@mail.gmail.com> <6a36e7290609221054y70be1997qbc412944f00b282a@mail.gmail.com> <234081550609221118w4706e908ke803fb0ffad92db3@mail.gmail.com> <6a36e7290609221129t10dd7676ob0c8731dcf068292@mail.gmail.com> <234081550609221156y2fd62f9cmb26a1fb20d4e3ae9@mail.gmail.com> Message-ID: <6a36e7290609221200w2c467e94h39ebe773650e7447@mail.gmail.com> On 9/22/06, Jack Wu wrote: > Wow Bob, > > Good suggestion. The application I'm using is Engal on Turbogears, a > prototype photosharing web app. The JPEG photos now load correctly. > > The Gif images do not, and I get a "IOError: cannot write mode P as > JPEG", but I will leave that to another thread after I do some > dissecting. You need to convert images that aren't already RGB in order to save them as JPEG. This might be a bug in Engal, but the fix would look something like this: if image.mode != "RGB": image = image.convert("RGB") -bob From fredrik at pythonware.com Fri Sep 22 21:54:00 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 22 Sep 2006 21:54:00 +0200 Subject: [Image-SIG] Need help installing PIL 1.1.5 on OSX (LONG) In-Reply-To: <6a36e7290609221200w2c467e94h39ebe773650e7447@mail.gmail.com> References: <234081550609212354iee3973bje06245bf26f2e027@mail.gmail.com> <4514123C.4080102@noaa.gov> <6a36e7290609220955y3e5e7277pf2633c35f8dc4db8@mail.gmail.com> <234081550609221021v7f300712i5301b864d8877804@mail.gmail.com> <6a36e7290609221054y70be1997qbc412944f00b282a@mail.gmail.com> <234081550609221118w4706e908ke803fb0ffad92db3@mail.gmail.com> <6a36e7290609221129t10dd7676ob0c8731dcf068292@mail.gmail.com> <234081550609221156y2fd62f9cmb26a1fb20d4e3ae9@mail.gmail.com> <6a36e7290609221200w2c467e94h39ebe773650e7447@mail.gmail.com> Message-ID: Bob Ippolito wrote: > You need to convert images that aren't already RGB in order to save > them as JPEG. This might be a bug in Engal, but the fix would look > something like this: > > if image.mode != "RGB": > image = image.convert("RGB") I'd recommend if image.mode not in ("L", "RGB"): image = image.convert("RGB") or even, to do the "right thing" for all possible modes: if image.mode not in ("L", "RGB"): image = image.convert(Image.getmodebase(image.mode)) From wulabs at gmail.com Fri Sep 22 22:10:37 2006 From: wulabs at gmail.com (Jack Wu) Date: Fri, 22 Sep 2006 13:10:37 -0700 Subject: [Image-SIG] Need help installing PIL 1.1.5 on OSX (LONG) In-Reply-To: References: <234081550609212354iee3973bje06245bf26f2e027@mail.gmail.com> <4514123C.4080102@noaa.gov> <6a36e7290609220955y3e5e7277pf2633c35f8dc4db8@mail.gmail.com> <234081550609221021v7f300712i5301b864d8877804@mail.gmail.com> <6a36e7290609221054y70be1997qbc412944f00b282a@mail.gmail.com> <234081550609221118w4706e908ke803fb0ffad92db3@mail.gmail.com> <6a36e7290609221129t10dd7676ob0c8731dcf068292@mail.gmail.com> <234081550609221156y2fd62f9cmb26a1fb20d4e3ae9@mail.gmail.com> <6a36e7290609221200w2c467e94h39ebe773650e7447@mail.gmail.com> Message-ID: <234081550609221310y5a300304p5fb72ceab8ab22ab@mail.gmail.com> Thanks Bob, Fredrik. Gifs work now. Expect to see a very cool TG app soon! :-) -Jack On 9/22/06, Fredrik Lundh wrote: > Bob Ippolito wrote: > > > You need to convert images that aren't already RGB in order to save > > them as JPEG. This might be a bug in Engal, but the fix would look > > something like this: > > > > if image.mode != "RGB": > > image = image.convert("RGB") > > I'd recommend > > if image.mode not in ("L", "RGB"): > image = image.convert("RGB") > > or even, to do the "right thing" for all possible modes: > > if image.mode not in ("L", "RGB"): > image = image.convert(Image.getmodebase(image.mode)) > > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > -- Jack Wu From pyimgsig.20.forest at xoxy.net Sun Sep 24 01:30:39 2006 From: pyimgsig.20.forest at xoxy.net (pyimgsig.20.forest at xoxy.net) Date: Sat, 23 Sep 2006 16:30:39 -0700 Subject: [Image-SIG] PIL.Image.load() returns None Message-ID: Hi there. I'm using PIL 1.1.6b1 with Python 2.5 on Windows. Can someone tell me why PIL.Image.getdata() and PIL.Image.load() cause subsequent PIL.Image.load() calls to return None? >>> import Image >>> im = Image.open('wire.png') >>> print type(im.load()) >>> print type(im.load()) >>> im = Image.open('wire.png') >>> print type(im.getdata()) >>> print type(im.load()) From fredrik at pythonware.com Sun Sep 24 10:32:13 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 24 Sep 2006 10:32:13 +0200 Subject: [Image-SIG] PIL.Image.load() returns None In-Reply-To: References: Message-ID: pyimgsig.20.forest at xoxy.net wrote: > I'm using PIL 1.1.6b1 with Python 2.5 on Windows. > > Can someone tell me why PIL.Image.getdata() and PIL.Image.load() cause > subsequent PIL.Image.load() calls to return None? it's a bug in ImageFile.load, most likely. here's a patch: Index: PIL/ImageFile.py =================================================================== --- PIL/ImageFile.py (revision 2802) +++ PIL/ImageFile.py (working copy) @@ -115,12 +115,12 @@ def load(self): "Load image data based on tile list" - Image.Image.load(self) + pixel = Image.Image.load(self) if self.tile is None: raise IOError("cannot load this image") if not self.tile: - return + return pixel self.map = None From Pierre.Barbier_de_Reuille at inria.fr Mon Sep 25 05:47:18 2006 From: Pierre.Barbier_de_Reuille at inria.fr (Pierre Barbier de Reuille) Date: Sun, 24 Sep 2006 21:47:18 -0600 Subject: [Image-SIG] Adding endianess support in PIL Message-ID: <45175146.9060302@inria.fr> Hello, First, AFAIK, there is no endianess support in PIL. But if there is, please tell me and forget about this mail. The problem in dealing with >8bits per channel images is the endianess become important. However, there is, for now, no way of knowing the endianess (unless you know a way specific to the format, as in the TIFF tags). So I propose to add a "byteorder" attribute (similar to the NumPy one) with the following values : '|' for "doesn't matter" (i.e. 8 bits per channel or less), '>' for "big endian" and '<' for "little endian". These values are taken from the NumPy lib. I don't know PIL enough to propose a patch or anything, but this would be, IMHO, a useful and quite easy addition to PIL. Pierre From Pierre.Barbier_de_Reuille at inria.fr Mon Sep 25 06:55:38 2006 From: Pierre.Barbier_de_Reuille at inria.fr (Pierre Barbier de Reuille) Date: Sun, 24 Sep 2006 22:55:38 -0600 Subject: [Image-SIG] Adding endianess support in PIL In-Reply-To: <45175B5C.9000500@holdenweb.com> References: <45175146.9060302@inria.fr> <45175B5C.9000500@holdenweb.com> Message-ID: <4517614A.8080202@inria.fr> Steve Holden a ?crit : > Pierre Barbier de Reuille wrote: >> Hello, >> >> First, AFAIK, there is no endianess support in PIL. But if there is, >> please tell me and forget about this mail. >> >> The problem in dealing with >8bits per channel images is the endianess >> become important. However, there is, for now, no way of knowing the >> endianess (unless you know a way specific to the format, as in the TIFF >> tags). So I propose to add a "byteorder" attribute (similar to the NumPy >> one) with the following values : '|' for "doesn't matter" (i.e. 8 bits >> per channel or less), '>' for "big endian" and '<' for "little endian". >> These values are taken from the NumPy lib. I don't know PIL enough to >> propose a patch or anything, but this would be, IMHO, a useful and quite >> easy addition to PIL. >> > Given that PIL doesn't appear to have endianness issues (which is to > say that the package already correctly adjusts to the endianness of > its platform) I'm not sure quite what this is supposed to buy. Well, what version are you referring to ? Because when I load 16-bits TIFF images with PIL and convert them to NumPy (using thee tostring method of the image), the result is not the same if the image was little endian or big endian. So maybe PIL, internally, knows which endianess is used and output correct values, but when converting to/from NumPy, as this value is not accessible, it becomes a problem ... isn't it ? > > In other words, let's just forget you ever said this ;-) > > regards > Steve From fredrik at pythonware.com Mon Sep 25 15:43:14 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 25 Sep 2006 15:43:14 +0200 Subject: [Image-SIG] Adding endianess support in PIL References: <45175146.9060302@inria.fr> <45175B5C.9000500@holdenweb.com> <4517614A.8080202@inria.fr> Message-ID: Pierre Barbier de Reuille wrote: > Well, what version are you referring to ? Because when I load 16-bits > TIFF images with PIL and convert them to NumPy (using thee tostring > method of the image), the result is not the same if the image was little > endian or big endian. does it work better if you convert mode "I" before passing the data to NumPy ? From fredrik at pythonware.com Mon Sep 25 17:12:56 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 25 Sep 2006 17:12:56 +0200 Subject: [Image-SIG] Adding endianess support in PIL In-Reply-To: References: <45175146.9060302@inria.fr> <45175B5C.9000500@holdenweb.com> <4517614A.8080202@inria.fr> Message-ID: Fredrik Lundh wrote: > does it work better if you convert mode "I" before passing the data to NumPy ? make that: convert to mode "I". From David.Bear at asu.edu Mon Sep 25 18:40:54 2006 From: David.Bear at asu.edu (David Bear) Date: Mon, 25 Sep 2006 09:40:54 -0700 Subject: [Image-SIG] verifying pil libraries Message-ID: <20060925164054.GA21541@asu.edu> I installed pil into a separate python instance on my machine. Running the setup I initially got an error that pil couldn't find libraries for jpeg. So I ran yast (I'm using suse 9.3 ) and installed the jpeg libaries. then rerunning setup for pil seemed to give a pass for jpeg and png. I continued the install. I also have a zope instance the uses this instance of python. Last week I attempted to use a producted that required pil to process a jpg. I got an exception that 'decoder jpeg not available'. So I think I have 3 questions. 1) how to clean up a pil installation that doesn't have the decoders that I need -- (do I need to remove the existing pil installation first) 2) what tests are available to check an existing pil installation for decoders it has available 3) what else do I need to install to make sure that pil has the libraries that it needs? Here's a list of jpeg libs I have installed via rpm's : rpm -qa | grep jpeg libjpeg-devel-32bit-9.3-7 jpeg-6b-738 libjpeg-32bit-9.3-7 libjpeg-devel-6.2.0-4 libjpeg-6.2.0-738 any advice? -- David Bear phone: 602-496-0424 fax: 602-496-0955 College of Public Programs/ASU University Center Rm 622 411 N Central Phoenix, AZ 85007-0685 "Beware the IP portfolio, everyone will be suspect of trespassing" From fredrik at pythonware.com Mon Sep 25 19:09:14 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 25 Sep 2006 19:09:14 +0200 Subject: [Image-SIG] verifying pil libraries In-Reply-To: <20060925164054.GA21541@asu.edu> References: <20060925164054.GA21541@asu.edu> Message-ID: David Bear wrote: > 1) how to clean up a pil installation that doesn't have the decoders > that I need -- (do I need to remove the existing pil installation > first) to see what PIL core build a certain Python interpreter is using, do: >>> import Image >>> Image.core.__file__ make sure that Python interpreter you're running Zope with picks up the same core file (usually something/something/_imaging.so). > 2) what tests are available to check an existing pil installation for > decoders it has available do >>> dir(Image.core) and look for functions named xyz_decoder (e.g. jpeg_decoder, gif_decoder). alternatively, just try to save an image as JPEG, and see what happens: >>> Image.new("L", (100, 100)).save("test.jpg") > 3) what else do I need to install to make sure that pil has the > libraries that it needs? Here's a list of jpeg libs I have installed > via rpm's : rpm -qa | grep jpeg > libjpeg-devel-32bit-9.3-7 > jpeg-6b-738 > libjpeg-32bit-9.3-7 > libjpeg-devel-6.2.0-4 > libjpeg-6.2.0-738 you need the header files, the build libraries, and the runtime libraries. if PIL's selftest says that JPEG support is working, you clearly have them all; all you need to do is to make sure that the Python interpreter you want to use PIL from is finding the right version of the _imaging.so file. hope this helps! From fredrik at pythonware.com Mon Sep 25 20:07:19 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 25 Sep 2006 20:07:19 +0200 Subject: [Image-SIG] PIL - numpy In-Reply-To: <4511CD79.8010203@noaa.gov> References: <18b571dd0609200613s1cbf4888uc1af3267e842e59c@mail.gmail.com> <4511CD79.8010203@noaa.gov> Message-ID: Christopher Barker wrote: > looking there, the numpy additions are listed in the most recent, "not > released" section. Is there a way to get that code and/or when do you > expect to release the next 1.1.6 beta? it would be good to have this > tested as numpy approached it's 1.0 release. my plan was to have a release candidate available *before* Python 2.5 was released, but stuff got in the way. I'll take another look at the 1.1.6 todo list and see what I can do. From john.walshaw at bbsrc.ac.uk Mon Sep 25 20:34:44 2006 From: john.walshaw at bbsrc.ac.uk (john walshaw (JIC)) Date: Mon, 25 Sep 2006 19:34:44 +0100 Subject: [Image-SIG] another libjpeg problem - PIL can't find it at runtime? (long) Message-ID: <286D8A554155B54CBFB18EF26EE2F169058751D6@jie2ksrv1.jic.bbsrc.ac.uk> Hi, I have a problem with PIL 1.1.5 with Python 2.2.3 on Tru 64. This is another libjpeg problem, occurring at runtime - there are no complaints from PIL about libjpeg when I build. I have libjpeg 6b. This appears to be a different problem to the one posted on 22nd. I can't say I'm too experienced with Python libs so hopefully I'm just making a very obvious mistake. Doing the PIL build proceeds to completion without errors, eventually showing "--- JPEG support ok" etc. But the selftest.py script gives: "*** The _imaging C module is not installed" It turns out that this is because _imaging.so can't resolve "jpeg_CreateCompress" (and presumably other jpeg_* routines if it got that far). E.g. if I do the following in the Imaging-1.1.5 dir: # python >>> import sys >>> sys.path.insert(1,"PIL") >>> import _imaging dlopen("PIL/_imaging.so", 2); Traceback (most recent call last): File "", line 1, in ? ImportError: dlopen: PIL/_imaging.so: symbol "jpeg_CreateCompress" unresolved If I just proceed with the installation anyway (python setup.py install), then everything seems to get put in the right place, but doing 'import _imaging' then just produces the same problem with the correctly installed _imaging, i.e. ImportError: dlopen: /usr/local/lib/python2.2/site-packages/PIL/_imaging.so: symbol "jpeg_CreateCompress" unresolved I have tried building from fresh again with various tweaks, e.g. adding JPEG_ROOT = "/usr/local/lib", "/usr/local/include" because that's where the libjpeg.a and jpeglib.h files are, and these both define jpeg_CreateCompress of course, but still the same problem occurs after the build. Attempts at non-fresh rebuilds just give: skipping '_imaging' extension (up-to-date) skipping '_imagingft' extension (up-to-date) Very basic question: how can I be sure where Python is looking for libs at runtime? Presumably there is something besides sys.path (which I did fiddle with just in case, but no luck). Any advice much appreciated. I've found a few descriptions of other libjpeg problems with PIL but am stumped with this. John From fredrik at pythonware.com Mon Sep 25 20:58:03 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 25 Sep 2006 20:58:03 +0200 Subject: [Image-SIG] another libjpeg problem - PIL can't find it at runtime? (long) In-Reply-To: <286D8A554155B54CBFB18EF26EE2F169058751D6@jie2ksrv1.jic.bbsrc.ac.uk> References: <286D8A554155B54CBFB18EF26EE2F169058751D6@jie2ksrv1.jic.bbsrc.ac.uk> Message-ID: john walshaw (JIC) wrote: > JPEG_ROOT = "/usr/local/lib", "/usr/local/include" > > because that's where the libjpeg.a and jpeglib.h files are, and these > both define jpeg_CreateCompress of course, but still the same problem > occurs after the build. did you build these yourself ? one brute-force workaround worth trying is to remove all libjpeg files except the static library (libjpeg.a) from /usr/local/lib and rebuild, to force the linker to do a static build. (it was a while since I did non-trivial build stuff on tru64, but I think that /usr/local/lib is used by default by the runtime linker. check the loader / runtime linker man page for details). From j.satchell at eris.qinetiq.com Tue Sep 26 20:02:58 2006 From: j.satchell at eris.qinetiq.com (Julian Satchell) Date: Tue, 26 Sep 2006 19:02:58 +0100 Subject: [Image-SIG] Bug in PIL 1.1.5 Message-ID: <1159293779.5399.35.camel@localhost.localdomain> The FT text renderer, accessed through the text method of an ImageDraw object does not seem to understand left bearing and right bearing on glyphs. As a result it wraps the overhanging part of the glyph, if this would leave the simplistic (bearing-free) bounding box, round to the far side of the bounding box. The effect can be seen most clearly when doing character at a time rendering, as the bounding box is then small. It is most likely to be seen on characters like "j" or "f", especially in oblique or swash fonts. Julian Satchell From fredrik at pythonware.com Tue Sep 26 20:42:24 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue, 26 Sep 2006 20:42:24 +0200 Subject: [Image-SIG] Bug in PIL 1.1.5 In-Reply-To: <1159293779.5399.35.camel@localhost.localdomain> References: <1159293779.5399.35.camel@localhost.localdomain> Message-ID: Julian Satchell wrote: > The FT text renderer, accessed through the text method of an ImageDraw > object does not seem to understand left bearing and right bearing on > glyphs. As a result it wraps the overhanging part of the glyph, if this > would leave the simplistic (bearing-free) bounding box, round to the far > side of the bounding box. The effect can be seen most clearly when doing > character at a time rendering, as the bounding box is then small. It is > most likely to be seen on characters like "j" or "f", especially in > oblique or swash fonts. the code that handles this was rewritten in 1.1.6 beta 1: http://effbot.org/zone/pil-changes-116.htm From john.walshaw at bbsrc.ac.uk Thu Sep 28 19:05:47 2006 From: john.walshaw at bbsrc.ac.uk (john walshaw (JIC)) Date: Thu, 28 Sep 2006 18:05:47 +0100 Subject: [Image-SIG] another libjpeg problem - PIL can't find it atruntime? (long) In-Reply-To: Message-ID: <286D8A554155B54CBFB18EF26EE2F169058751DF@jie2ksrv1.jic.bbsrc.ac.uk> Fredrik Lundh wrote: > john walshaw (JIC) wrote: > > > > because that's where the libjpeg.a and jpeglib.h files are, > > did you build these yourself ? > > one brute-force workaround worth trying is to remove all > libjpeg files > except the static library (libjpeg.a) from /usr/local/lib and > rebuild, > to force the linker to do a static build. > thanks for the suggestion. I've tried it out, and the short story is that again the compilation completes, but I'm now getting a different runtime problem when I import the _imaging library - I get this: >>> import sys >>> sys.path.insert(1,"PIL") >>> import _imaging Traceback (most recent call last): File "", line 1, in ? ImportError: dlopen: Cannot map library PIL/_imaging.so The long story is - first to answer your question, I hadn't built libjpeg myself, so one thing I tried was getting the most recent source and building this again, and using that for the compilation, ensuring that the older one doesn't get used. I have the same error when trying to import the _imaging built with the new one. As far as forcing a static build using libjpeg.a goes - I did try the brute force method, producing the _libjpeg.so which gives the above error. However I also tried a cleaner way of doing this with running the linker with -non_shared, and -ljpeg, and forcing (with -L ) the linker to never look anywhere except the dirs specified with the other -L qualifiers. This produced the same error unfortunately. I also tried doing both the non-static and static builds using the native cc instead of gcc which setup.py uses by default, but in each case the cc build gives the same respective run-time error as with gcc. (I have another beginner's question here - how do I cleanly tell setup.py which compiler and directives to use?). Finally, I decided to do a fresh install of Python itself, so I installed Python 2.5 in a separate location, and used the 2.5 executable to do the PIL build and then attempt the import of _imaging - but I got the same error message as before. Any ideas, or if anyone on this list has PIL on Tru64, I'd be grateful to hear from them. best wishes John From adeuring at gmx.net Fri Sep 29 19:03:48 2006 From: adeuring at gmx.net (abel deuring) Date: Fri, 29 Sep 2006 19:03:48 +0200 Subject: [Image-SIG] [ANN] Sane frontend, based on Python/PIL/PyGTK Message-ID: <451D51F4.8030608@gmx.net> I have started work on Eikazo, a new Sane frontend (http://eikazo.berlios.de). It focuses on "mass scans", especially with ADF scanners -- it is not intended to compete with XSane or Kooka with their quite elaborate functions. Some Eikazo features: - To maximize throughput for ADF scanners, a new scan is started, while the previous scan is being processed and stored or printed. - plugin mechanisms to support special device features, image processing and output modules. Currently, plugins exist for: o image rotation (If a duplex ADF scanner is used, different rotation angles can be selected for frontside and backside) duplex scanners) o automatic thresholding o "dirt removal" o support for some speical features of the Fujitsu fi4120 and fi5120 scanners - Scanned images can be saved to a file and optionally simultaneously printed ("print only" if course possible too). - scan parameters can be saved in an SQL database (MySQL and PostgreSQL are supported). This option is probably not very useful in most cases; it is intended as an example, how output functions can be customized. Technically, the frontend is based on Python, GTK/PyGTK and the Python Imaging Library. The program is released under the GPL. Abel From fredrik at pythonware.com Fri Sep 29 19:19:04 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 29 Sep 2006 19:19:04 +0200 Subject: [Image-SIG] [ANN] Sane frontend, based on Python/PIL/PyGTK In-Reply-To: <451D51F4.8030608@gmx.net> References: <451D51F4.8030608@gmx.net> Message-ID: abel deuring wrote: > I have started work on Eikazo, a new Sane frontend > (http://eikazo.berlios.de). It focuses on "mass scans", especially > with ADF scanners -- it is not intended to compete with XSane or > Kooka with their quite elaborate functions. > > Some Eikazo features: cool! is the updated sane module in the PIL directory the latest and greatest? should I simply grab a copy of that for PIL 1.1.6 ? From jmikulasek at gmail.com Sat Sep 30 00:50:12 2006 From: jmikulasek at gmail.com (=?ISO-8859-2?Q?Ji=F8=ED_Mikul=E1=B9ek?=) Date: Sat, 30 Sep 2006 00:50:12 +0200 Subject: [Image-SIG] Drawing filled polygons with holes with aggdraw Message-ID: <89681a450609291550x56b3d43ch40c9ee0f894ba254@mail.gmail.com> Hello, I would like to ask whether it is possible to draw properly filled multipolygons with aggdraw. By properly filled I mean that when I have for example multipolygon consisting of two polygons where one is inside another - some call these objects polygons with holes - and want to draw it with solid fill, then I would like to have filled only the space between them. I know that it is easy to draw multipolygons without holes - just draw individual polygons one by one, but polygons with holes can not be drawn like that. Is there currently any way I am not aware of? If not, is it likely to get implemented? And if it is not likely :-) how difficult it would be to implement it for someone who is not very familiar with agg? Is it possible at all? Thank you very much. Jirka Mikulasek From adeuring at gmx.net Sat Sep 30 20:54:48 2006 From: adeuring at gmx.net (abel deuring) Date: Sat, 30 Sep 2006 20:54:48 +0200 Subject: [Image-SIG] [ANN] Sane frontend, based on Python/PIL/PyGTK In-Reply-To: References: <451D51F4.8030608@gmx.net> Message-ID: <451EBD78.7090006@gmx.net> Fredrik Lundh wrote: >>I have started work on Eikazo, a new Sane frontend >>(http://eikazo.berlios.de). It focuses on "mass scans", especially >>with ADF scanners -- it is not intended to compete with XSane or >>Kooka with their quite elaborate functions. >> >>Some Eikazo features: > > cool! Thanks :) > > is the updated sane module in the PIL directory the latest and greatest? > should I simply grab a copy of that for PIL 1.1.6 ? Uhhh, no ;) There is some newer stuff available (attached to this mail) While the version packed with Eikazo has better threading support (very useful for Eikazo ;), I've worked meanwhile on another patch for _sane.c, but this patch may need some discussion. The changes are related to Sane integer and fixed number options that have more than one element (i.e., that are arrays of numbers; the most important usage are gamma curves implemented in a scanner's firmware). Without this patch, such options are not readable (except for the first array element) or settable by PIL's Sane module. I made two changes: 1. Sane "array options" are now returned as lists of Python integers resp. floats. If such an option is set, any Python sequence type can be passed as the option's value (provided of course that is has the correct length). 2. the length of such an "array option" is given in the Sane API (http://www.sane-project.org/html/doc011.html) by the field 'size' of struct SANE_Option_Descriptor. The data of this struct is mapped by SaneDev_get_options in _sane.c to an element of a Python tuple. SANE_Option_Descriptor.size gives the length of the data array in _bytes_, i.e., not the number of array elements. The "offical Sane way" to get the number of array elements in C is to calculate SANE_Option_Descriptor.size/sizeof(SANE_Word) -- but this division is not present in the current "offical" versions of the Python Sane module. Instead, the length in bytes is simply passed to the caller of SaneDev_get_options. The attached version of _sane.c has this division, making it easier and more reliable to get the "real" array length in Python. Needing to divide the size value by the "magic constant" 4 in Python is IMHO a bit strange ;) Moreover, I am not sure, if sizeof(SANE_Word) is 4 or 8 on 64 bit platforms... On the other hand, this is an slight incompatibility to older versions. I don't believe that the size of a Sane option has been used so far very much in real application, because "array options" were not useable anyway, so the nummber of affected applications should be close to zero -- but this is a guess: I don't know every application that uses PIL and PIL's Sane module ;) On the other hand, one can also detect the array size in Python from the length of the list returned by SaneDev_get_option in the new version of _sane.c, so there is no urgent need for the division by sizeof(SANE_Word) -- it may just be more convenient in some cases. To sum up possible problems: 1. A very naive application that simply tries to access every scanner option of type SANE_Int or SANE_Fixed without checking its length will probably break. On the other hand, an application that simply works with the first element of an array instead of the entire array needs to be fixed anyway. 2. The change in SaneDev_get_options -- the division SANE_Option_Descriptor.size/sizeof(SANE_Word) -- may break applications that make this calculation for themselves in order to avoid to access (up to now useless) array options. Any comments, especially on the second change/problem? Abel -------------- next part -------------- A non-text attachment was scrubbed... Name: _sane.c Type: text/x-csrc Size: 42355 bytes Desc: not available Url : http://mail.python.org/pipermail/image-sig/attachments/20060930/9e2b12a0/attachment-0001.c