From simonsez at gmail.com Tue Jun 1 22:16:38 2010 From: simonsez at gmail.com (Simon Mosk-Aoyama) Date: Tue, 1 Jun 2010 13:16:38 -0700 Subject: [Image-SIG] broken data stream when reading image file In-Reply-To: References: Message-ID: Hello Fredrik, Thanks so much for the response, your explanation makes sense to me though I'm not quite sure how to solve it. Here are the results of the python commands you gave me: Python 2.6.5 (r265:79063, Apr 17 2010, 18:49:39) [GCC 4.2.1 (Apple Inc. build 5659)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path.insert(0, ".") >>> from PIL import Image Im>>> Image.core >>> from PIL import _imaging Traceback (most recent call last): File "", line 1, in ImportError: cannot import name _imaging I assume the problem has to do with the missing _imaging file, is this correct? thanks! -simon On Sat, May 29, 2010 at 5:51 AM, Fredrik Lundh wrote: > The confusion here is that setup.py reports what it identified, and > what parts it told the distutils system to build (expecting distutils > to yell if something went wrong), while the selftest.py reports what > it actually found for the PIL build it managed to import. Usually, > having the first one build things successfully means that the second > one will be able to test them successfully, but sometimes, things go > wrong on the way (and that seems to be especially likely if you have > debris around from earlier build attempts). > > In your case, when you run the test, the following happens: > > 1. imports the PIL.Image.py module (which succeeds) > this imports some other components, including _imaging (succeeds) > 2. imports _imaging again, explicitly (FAILS, which results in the > PIL CORE complaint) > 3. checks that the _imaging module imported by Image.py has a JPEG > codec (succeeds) > 4. checks that the _imaging module imported by Image.py has a ZLIB > codec (succeeds) > 5. checks for a few more support modules, by importing them > explicitly (FAILS) > 6. tries to use the JPEG module to read a sample file (FAILS) > > My guess is that the _imaging.so module built by setup.py doesn't > work, for some reason, and that Python then goes ahead and imports the > one under /opt/local/Library/Frameworks/Python.framework/... instead, > which can be imported, but has a broken JPEG module (either that, or > the sample file is damaged). You can check this by doing: > > $ python > >>> import sys > >>> sys.path.insert(0, ".") > >>> from PIL import Image > >>> Image.core > ... this will tell you from where PIL pulled the _imaging module ... > >>> from PIL import _imaging > >>> _imaging > > Let us know if this results in any errors. Also make sure that the > Image.core output is the module you built yourself. > > To check if the sample file is ok, open it in some other program. > > > > On Sat, May 29, 2010 at 4:03 AM, Simon Mosk-Aoyama > wrote: > > Hello, > > > > I'm trying to get PIL to work on my OS X 10.6 box, and unfortunately > > have ran into some trouble with the JPEG CODEC. > > > > I installed the library from port, but when I try to run my > > application and read a JPEG I get the following error: > > broken data stream when reading image file > > > > Tracing this back to PIL I went to install PIL manually, which seems to > succeed: > > > > -------------------------------------------------------------------- > > PIL 1.1.7 SETUP SUMMARY > > -------------------------------------------------------------------- > > version 1.1.7 > > platform darwin 2.6.5 (r265:79063, Apr 17 2010, 18:49:39) > > [GCC 4.2.1 (Apple Inc. build 5659)] > > -------------------------------------------------------------------- > > --- TKINTER support available > > --- JPEG support available > > --- ZLIB (PNG/ZIP) support available > > --- FREETYPE2 support available > > --- LITTLECMS support available > > -------------------------------------------------------------------- > > > > And yet when I run python selftest.py I get: > > -------------------------------------------------------------------- > > PIL 1.1.7 TEST SUMMARY > > -------------------------------------------------------------------- > > Python modules loaded from ./PIL > > Binary modules loaded from > > > /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL > > -------------------------------------------------------------------- > > *** PIL CORE support not installed > > *** TKINTER support not installed > > --- JPEG support ok > > --- ZLIB (PNG/ZIP) support ok > > *** FREETYPE2 support not installed > > *** LITTLECMS support not installed > > -------------------------------------------------------------------- > > Running selftest: > > ***************************************************************** > > Failure in example: > > try: > > _info(Image.open(os.path.join(ROOT, "Images/lena.jpg"))) > > except IOError, v: > > print v > > from line #24 of selftest.testimage > > Expected: ('JPEG', 'RGB', (128, 128)) > > Got: broken data stream when reading image file > > 1 items had failures: > > 1 of 57 in selftest.testimage > > ***Test Failed*** 1 failures. > > *** 1 tests of 57 failed. > > > > So far searches on the error message haven't turned up anything. I'm a > > little concerned about the PIL_CORE not installed message, should I > > be? > > > > Any ideas? > > > > Thanks > > > > -Simon > > _______________________________________________ > > Image-SIG maillist - Image-SIG at python.org > > http://mail.python.org/mailman/listinfo/image-sig > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yury at shurup.com Thu Jun 3 12:49:20 2010 From: yury at shurup.com (Yury V. Zaytsev) Date: Thu, 03 Jun 2010 12:49:20 +0200 Subject: [Image-SIG] PIL binaries -- please test In-Reply-To: <4BFD6148.8000407@noaa.gov> References: <4BFC2BA8.6040809@noaa.gov> <1274858227.6918.10.camel@mypride> <4BFD6148.8000407@noaa.gov> Message-ID: <1275562160.6863.20.camel@mypride> Hi! On Wed, 2010-05-26 at 10:58 -0700, Christopher Barker wrote: > > > > For instance, I have a whole bunch of Macs out there... > > great -- are any of them running 10.4? > Unfortunately all of them are latest 10.5.x + I don't seem to have root there :-( -- Sincerely yours, Yury V. Zaytsev From valery_ at abv.bg Fri Jun 4 22:00:46 2010 From: valery_ at abv.bg (=?utf-8?B?0JLQsNC70LXRgNC4INCc0LjQu9C10LI=?=) Date: Fri, 4 Jun 2010 23:00:46 +0300 (EEST) Subject: [Image-SIG] Array to image problem. Message-ID: <938489840.185509.1275681646506.JavaMail.apache@nm1.abv.bg> Hello, I'm not a programer ,but i need to make a little program now and I need a little help. I'm using: Python 2.6.4 |EPD 6.1-1 (32-bit)| (r264:75706, Nov 11 2009, 19:42:36) [MSC v.1500 32 bit (Intel)] on win32 I have a array, which contains the pixel values for luminance in a picture. Now I need to save this array as jpg. I have tried with i = Image.fromarray(myArray) i.save("C:/test/mess.jpg") but the result is a big mess of random black and white pixels. This is how I get the array form the original Image: im1=Image.open('C:/test/1.jpg','r') neueBilder1 = im1.split() Werte1 = array(neueBilder1[0].getdata()) Matrix1 = reshape(Werte1,(480,640)) I appreciate your help! Valeri Milev Valeri Milev

-----------------------------------------------------------------
????? ???-??????????? ?? ?????????? ?????????? ? ???. ????? ?????? ?? ???! -------------- next part -------------- An HTML attachment was scrubbed... URL: From simonsez at gmail.com Sat Jun 5 01:29:26 2010 From: simonsez at gmail.com (Simon Mosk-Aoyama) Date: Fri, 4 Jun 2010 16:29:26 -0700 Subject: [Image-SIG] Getting PIL to work on OSX Snow Leopard Message-ID: Hi All- I posted last week about a problem I was having, and Fredrick was kind enough to point me in the right direction towards fixing my problem, but unfortunately I spent the better part of today failing to get PIL to work on my OSX Snow Leopard box, so I thought before I abandon my attempts to get this to work I'd post again here. I initially tried to install both libjpeg and PIL via Darwin Ports, but unfortunately when reading a JPG I would get the following error: broken data stream when reading image file I then tried to install PIL via source but I received a mismatch error where PIL was looking for version libjpeg 62 while Port had installed version 8.0. So I went back and installed libjpeg 6b from source using the instructions I found on this blog post: http://jetfar.com/libjpeg-and-python-imaging-pil-on-snow-leopard/ tar zxvf jpegsrc.v6b.tar.gz cd jpeg-6b cp /usr/share/libtool/config/config.sub . cp /usr/share/libtool/config/config.guess . ./configure --enable-shared --enable-static make sudo make install This seemed successful as the files seem to have installed fine: simon@/Users/simon/: ls -al /usr/local/lib/*jpeg* -rw-r--r-- 1 root wheel 201336 Jun 4 15:56 /usr/local/lib/libjpeg.a -rwxr-xr-x 1 root wheel 433 Jun 4 15:56 /usr/local/lib/libjpeg.la I then downloaded PIL 1.1.7 and edited setup.py to have JPEG_ROOT = libinclude("/usr/local") and ran: python setup.py build_ext -i and got: running build_ext --- using frameworks at /System/Library/Frameworks -------------------------------------------------------------------- PIL 1.1.7 SETUP SUMMARY -------------------------------------------------------------------- version 1.1.7 platform darwin 2.6.5 (r265:79063, Apr 17 2010, 18:49:39) [GCC 4.2.1 (Apple Inc. build 5659)] -------------------------------------------------------------------- --- TKINTER support available --- JPEG support available --- ZLIB (PNG/ZIP) support available --- FREETYPE2 support available --- LITTLECMS support available -------------------------------------------------------------------- To check the build, run the selftest.py script. Running the selftest: simon@/Users/simon/: python selftest.py -------------------------------------------------------------------- PIL 1.1.7 TEST SUMMARY -------------------------------------------------------------------- Python modules loaded from ./PIL Binary modules loaded from ./PIL -------------------------------------------------------------------- --- PIL CORE support ok --- TKINTER support ok --- JPEG support ok --- ZLIB (PNG/ZIP) support ok --- FREETYPE2 support ok --- LITTLECMS support ok -------------------------------------------------------------------- Running selftest: ***************************************************************** Failure in example: try: _info(Image.open(os.path.join(ROOT, "Images/lena.jpg"))) except IOError, v: print v from line #24 of selftest.testimage Expected: ('JPEG', 'RGB', (128, 128)) Got: broken data stream when reading image file 1 items had failures: 1 of 57 in selftest.testimage ***Test Failed*** 1 failures. *** 1 tests of 57 failed. Checking to ensure the file I built is being executed I run: simon@/Users/simon/source/sls_scrapers/Imaging-1.1.7: python Python 2.6.5 (r265:79063, Apr 17 2010, 18:49:39) [GCC 4.2.1 (Apple Inc. build 5659)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path.insert(0, '.') >>> from PIL import Image >>> Image.core >>> image = Image.open('images/lena.jpg') >>> image >>> image.load() Traceback (most recent call last): File "", line 1, in File "./PIL/ImageFile.py", line 215, in load raise_ioerror(e) File "./PIL/ImageFile.py", line 52, in raise_ioerror raise IOError(message + " when reading image file") IOError: broken data stream when reading image file I'm at a bit of a standstill now as I can't figure out what else to do - I've seemingly re-built libjpeg correctly from source and have re-built PIL to point at this newly built libjpeg, but it's still failing. Does anyone else have any idea how to solve this? thanks! -simon -------------- next part -------------- An HTML attachment was scrubbed... URL: From yury at shurup.com Sat Jun 5 11:05:26 2010 From: yury at shurup.com (Yury V. Zaytsev) Date: Sat, 05 Jun 2010 11:05:26 +0200 Subject: [Image-SIG] Array to image problem. In-Reply-To: <938489840.185509.1275681646506.JavaMail.apache@nm1.abv.bg> References: <938489840.185509.1275681646506.JavaMail.apache@nm1.abv.bg> Message-ID: <1275728726.6596.14.camel@mypride> Hi ??????! Check this thread out for the explanation and my later postings for the cut and paste solution: http://mail.python.org/pipermail/image-sig/2010-April/006213.html -- Sincerely yours, Yury V. Zaytsev From yury at shurup.com Sat Jun 5 15:32:35 2010 From: yury at shurup.com (Yury V. Zaytsev) Date: Sat, 05 Jun 2010 15:32:35 +0200 Subject: [Image-SIG] Array to image problem. In-Reply-To: <2111864288.19563.1275735426304.JavaMail.apache@mail22.abv.bg> References: <2111864288.19563.1275735426304.JavaMail.apache@mail22.abv.bg> Message-ID: <1275744755.6596.52.camel@mypride> Hi! Please don't post off the list. I am under the impression that you are preparing the array in the wrong way: not only you need to have a 480x640 matrix for 640x480 image, but it also have to be transposed correctly. Also, if you need luminance only why wouldn't you just use the grayscale mode? -- Sincerely yours, Yury V. Zaytsev From Chris.Barker at noaa.gov Sat Jun 5 19:15:34 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Sat, 05 Jun 2010 10:15:34 -0700 Subject: [Image-SIG] Getting PIL to work on OSX Snow Leopard In-Reply-To: References: Message-ID: <4C0A8636.4020601@noaa.gov> Simon Mosk-Aoyama wrote: > I've seemingly re-built libjpeg correctly from source and > have re-built PIL to point at this newly built libjpeg, but it's still > failing. It sure looks like you've done the right thing... > Does anyone else have any idea how to solve this? NO, but something that might give a hint. Try: $ otool -L PIL/_imaging.so That will tell you what PIL is linked against. Once you see that, you may want to run otool on the libs it's linked against, too. What python are you using? If you use the one from python.org, you can use the binary I posted a little bit ago: http://dl.dropbox.com/u/855965/PIL-OSX-Binaries/PIL-1.1.7-py2.6-macosx10.5.mpkg.zip I built those by building libjpeg, etc. with macports, then the usual setup.py build -- it "just worked" for me I got lucky, I suppose! -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (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 Chris.Barker at noaa.gov Sat Jun 5 19:22:22 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Sat, 05 Jun 2010 10:22:22 -0700 Subject: [Image-SIG] [Pythonmac-SIG] PIL binaries -- please test In-Reply-To: <4C0A8459.2090202@gmail.com> References: <4BFC2BA8.6040809@noaa.gov> <1274858227.6918.10.camel@mypride> <4BFD6148.8000407@noaa.gov> <4C0A8459.2090202@gmail.com> Message-ID: <4C0A87CE.5090902@noaa.gov> Matthias Baas wrote: > Christopher Barker wrote: >> great -- are any of them running 10.4? >> >> I have little time, but here is the short version: >> >> The goal is to get a PIL binary that is statically linked to all of its >> dependencies, and those dependencies are all universal (32 bit PPC and >> Intel) and linked against the 10.4 sdk (or even the 10.3 one...) >> [...] > > Finally, I had some time to have a go at this. It builds fine and it > says that every component is available but when I run selftest.py it > seems that some stuff is missing: > > -------------------------------------------------------------------- > *** PIL CORE support not installed That sure doesn't look good! > *** TKINTER support not installed > --- JPEG support ok > --- ZLIB (PNG/ZIP) support ok > *** FREETYPE2 support not installed > *** LITTLECMS support not installed neither do those. > -------------------------------------------------------------------- > Running selftest: > --- 57 tests passed. > > The files _imagingcms.so, _imagingft.so, _imagingtk.so are all > available, so I can't say what exactly went wrong with the test. what about _imaging.so -- that's the key one. This is my full set of libs: _imaging.so _imagingcms.so _imagingft.so _imagingmath.so _imagingtk.so Look again at the output when you build -- there's got to be an error in there somewhere. And do make sure you clean out the "build" dir before trying again. > So it looks like my build is not really ready for distributing. nope -- but thanks for workign on it -- I hope yu keep at at. sorry I don't have any answers for you. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (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 yury at shurup.com Sat Jun 5 21:19:09 2010 From: yury at shurup.com (Yury V. Zaytsev) Date: Sat, 05 Jun 2010 21:19:09 +0200 Subject: [Image-SIG] Array to image problem. In-Reply-To: <2077129678.22020.1275763239166.JavaMail.apache@mail23.abv.bg> References: <2077129678.22020.1275763239166.JavaMail.apache@mail23.abv.bg> Message-ID: <1275765549.6596.80.camel@mypride> Hi! I will not reply to any further messages you send me off the list! On Sat, 2010-06-05 at 21:40 +0300, ?????? ????? wrote: > with .convert("L") and array=asarray(i) works! Thaks for the Tip!! > That is very strange because the values are the same like im my > method. The only difreance I noticed is that the data type is "uint8". > Any way, my array is a result of sustraction from images and now with > "uint8" when one pixel has a value 15 - 20=250. Insead of black I have > white. Do you know how can a overcome this issue? I don't know what you are doing and what you want to achieve. In grayscale mode the colors have to be in the range from 0 to 255 and it's your responsibility to assure this is the case before you convert your matrix to the image. You can do your matrix operations on matrices of higher bitness and re-normalize them before you convert to uint8 using NumPy to feed into PIL. -- Sincerely yours, Yury V. Zaytsev From matthias.baas at gmail.com Sat Jun 5 19:07:37 2010 From: matthias.baas at gmail.com (Matthias Baas) Date: Sat, 05 Jun 2010 18:07:37 +0100 Subject: [Image-SIG] [Pythonmac-SIG] PIL binaries -- please test In-Reply-To: <4BFD6148.8000407@noaa.gov> References: <4BFC2BA8.6040809@noaa.gov> <1274858227.6918.10.camel@mypride> <4BFD6148.8000407@noaa.gov> Message-ID: <4C0A8459.2090202@gmail.com> Christopher Barker wrote: > great -- are any of them running 10.4? > > I have little time, but here is the short version: > > The goal is to get a PIL binary that is statically linked to all of its > dependencies, and those dependencies are all universal (32 bit PPC and > Intel) and linked against the 10.4 sdk (or even the 10.3 one...) > [...] Finally, I had some time to have a go at this. It builds fine and it says that every component is available but when I run selftest.py it seems that some stuff is missing: -------------------------------------------------------------------- *** PIL CORE support not installed *** TKINTER support not installed --- JPEG support ok --- ZLIB (PNG/ZIP) support ok *** FREETYPE2 support not installed *** LITTLECMS support not installed -------------------------------------------------------------------- Running selftest: --- 57 tests passed. The files _imagingcms.so, _imagingft.so, _imagingtk.so are all available, so I can't say what exactly went wrong with the test. By the way, when linking against the static libraries I actually can't import _imagingft manually because of a missing symbol (_FSOpenResFile). But I also get the above output when running the test with a version that's linked against the dynamic libraries. So it looks like my build is not really ready for distributing. - Matthias - From simonsez at gmail.com Sat Jun 5 20:05:14 2010 From: simonsez at gmail.com (Simon Mosk-Aoyama) Date: Sat, 5 Jun 2010 11:05:14 -0700 Subject: [Image-SIG] Getting PIL to work on OSX Snow Leopard In-Reply-To: <4C0A8636.4020601@noaa.gov> References: <4C0A8636.4020601@noaa.gov> Message-ID: Chris, Thanks so much for the suggestion! I ran the otool command and noted that the _imaging.so is linked to the wrong (newer) libjpeg: simon@/Users/simon/: otool -L PIL/_imaging.so PIL/_imaging.so: /opt/local/lib/libjpeg.8.dylib (compatibility version 9.0.0, current version 9.1.0) /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.1) so seems like I may have misconfigured setup.py. Can anyone confirm this would be the right syntax: JPEG_ROOT = libinclude("/usr/local") for linking to: simon@/Users/simon/: ls -al /usr/local/lib/*jpeg* -rw-r--r-- 1 root wheel 201336 Jun 4 15:56 /usr/local/lib/libjpeg.a -rwxr-xr-x 1 root wheel 433 Jun 4 15:56 /usr/local/lib/libjpeg.la Hmmm I'm noticing I don't have an equivalent libjpeg.dylib for the 6b version - should I have that, and could that be the cause of the linking being broken? thanks! -Simon On Sat, Jun 5, 2010 at 10:15 AM, Christopher Barker wrote: > Simon Mosk-Aoyama wrote: > > I've seemingly re-built libjpeg correctly from source and >> have re-built PIL to point at this newly built libjpeg, but it's still >> failing. >> > > It sure looks like you've done the right thing... > > > > Does anyone else have any idea how to solve this? >> > > NO, but something that might give a hint. Try: > > $ otool -L PIL/_imaging.so > > That will tell you what PIL is linked against. > > Once you see that, you may want to run otool on the libs it's linked > against, too. > > What python are you using? If you use the one from python.org, you can use > the binary I posted a little bit ago: > > > http://dl.dropbox.com/u/855965/PIL-OSX-Binaries/PIL-1.1.7-py2.6-macosx10.5.mpkg.zip > > I built those by building libjpeg, etc. with macports, then the usual > setup.py build -- it "just worked" for me I got lucky, I suppose! > > -Chris > > > > > -- > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias.baas at gmail.com Sat Jun 5 20:47:55 2010 From: matthias.baas at gmail.com (Matthias Baas) Date: Sat, 05 Jun 2010 19:47:55 +0100 Subject: [Image-SIG] [Pythonmac-SIG] PIL binaries -- please test In-Reply-To: <4C0A87CE.5090902@noaa.gov> References: <4BFC2BA8.6040809@noaa.gov> <1274858227.6918.10.camel@mypride> <4BFD6148.8000407@noaa.gov> <4C0A8459.2090202@gmail.com> <4C0A87CE.5090902@noaa.gov> Message-ID: <4C0A9BDB.9050403@gmail.com> Christopher Barker wrote: >> *** PIL CORE support not installed > > That sure doesn't look good! > >> *** TKINTER support not installed >> --- JPEG support ok >> --- ZLIB (PNG/ZIP) support ok >> *** FREETYPE2 support not installed >> *** LITTLECMS support not installed > > neither do those. Ha! I haven't had a look at selftest.py before. That script requires an inplace build which I didn't do. Instead, I was pointing PYTHONPATH inside the build directory and thought it would then pick the modules up from there, but the test script imports from "PIL" which is not available in the build directory, so it failed to import any of the so libs. After doing an inplace build, the test script runs fine. But when I link against the static lib, the test script only runs fine because it imports the tk module before the freetype one. Whereas when I just import _imagingft, I get this: >>> import PIL._imagingft Traceback (most recent call last): File "", line 1, in ImportError: dlopen(PIL/_imagingft.so, 2): Symbol not found: _FSOpenResFile Referenced from: PIL/_imagingft.so Expected in: dynamic lookup This error does not occur if _imagingtk is imported first. So it looks like we would have to link against some system library when building _imagingft. By the way, _imaging.so still depends on /usr/lib/libz.1.dylib, but I suppose as this is a library that ships with OSX, this should be available on all systems and so it should be fine. Is this correct? - Matthias - From Chris.Barker at noaa.gov Sat Jun 5 21:48:08 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Sat, 05 Jun 2010 12:48:08 -0700 Subject: [Image-SIG] [Pythonmac-SIG] PIL binaries -- please test In-Reply-To: <4C0A9BDB.9050403@gmail.com> References: <4BFC2BA8.6040809@noaa.gov> <1274858227.6918.10.camel@mypride> <4BFD6148.8000407@noaa.gov> <4C0A8459.2090202@gmail.com> <4C0A87CE.5090902@noaa.gov> <4C0A9BDB.9050403@gmail.com> Message-ID: <4C0AA9F8.1030908@noaa.gov> Matthias Baas wrote: > Christopher Barker wrote: > Ha! I haven't had a look at selftest.py before. That script requires an > inplace build which I didn't do. Instead, I was pointing PYTHONPATH > inside the build directory yup -- that will confuse things. > But when I link > against the static lib, the test script only runs fine because it > imports the tk module before the freetype one. Whereas when I just > import _imagingft, I get this: > >>>> import PIL._imagingft > Traceback (most recent call last): > File "", line 1, in > ImportError: dlopen(PIL/_imagingft.so, 2): Symbol not found: _FSOpenResFile > Referenced from: PIL/_imagingft.so > Expected in: dynamic lookup > > This error does not occur if _imagingtk is imported first. So it looks > like we would have to link against some system library when building > _imagingft. could be -- I'm clueless on that one, but if I try in it: >>> import PIL._imagingft Traceback (most recent call last): File "", line 1, in ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/_imagingft.so, 2): Symbol not found: _inflateEnd Referenced from: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/_imagingft.so Expected in: dynamic lookup What I don't know is if we should expect -imagingft to b importable all by itself, first. Though I wouldn't think it should depend on TK. If I do: >>> import PIL._imaging >>> import PIL._imagingft it works fine -- which makes sense --you'd never need to import _imagingft without importing _imaging first. > By the way, _imaging.so still depends on /usr/lib/libz.1.dylib, but I > suppose as this is a library that ships with OSX, this should be > available on all systems and so it should be fine. Is this correct? yes -- that's correct. I'd say if all the self-tests run, you're in pretty good shape. Try the enclosed test, too -- it uses freetype, without TK (at least not explicitly) -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (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 -------------- next part -------------- A non-text attachment was scrubbed... Name: SimplePILTest.py Type: application/x-python Size: 614 bytes Desc: not available URL: From matthias.baas at gmail.com Sun Jun 6 19:56:19 2010 From: matthias.baas at gmail.com (Matthias Baas) Date: Sun, 06 Jun 2010 18:56:19 +0100 Subject: [Image-SIG] [Pythonmac-SIG] PIL binaries -- please test In-Reply-To: <4C0AA9F8.1030908@noaa.gov> References: <4BFC2BA8.6040809@noaa.gov> <1274858227.6918.10.camel@mypride> <4BFD6148.8000407@noaa.gov> <4C0A8459.2090202@gmail.com> <4C0A87CE.5090902@noaa.gov> <4C0A9BDB.9050403@gmail.com> <4C0AA9F8.1030908@noaa.gov> Message-ID: <4C0BE143.4070704@gmail.com> Christopher Barker wrote: >>>>> import PIL._imagingft >> Traceback (most recent call last): >> File "", line 1, in >> ImportError: dlopen(PIL/_imagingft.so, 2): Symbol not found: >> _FSOpenResFile >> Referenced from: PIL/_imagingft.so >> Expected in: dynamic lookup >> >> This error does not occur if _imagingtk is imported first. So it looks >> like we would have to link against some system library when building >> _imagingft. > > could be -- I'm clueless on that one, but if I try in it: > >>>> import PIL._imagingft > Traceback (most recent call last): > File "", line 1, in > ImportError: > dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/_imagingft.so, > 2): Symbol not found: _inflateEnd > Referenced from: > /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/_imagingft.so > > Expected in: dynamic lookup > > What I don't know is if we should expect -imagingft to b importable all > by itself, first. Though I wouldn't think it should depend on TK. > > If I do: > >>>> import PIL._imaging >>>> import PIL._imagingft The second import still fails for me. But in your case, it was the symbol _inflateEnd that was missing which is from zlib. _imaging also depends on zlib, so that explains why importing _imaging first fixes the second import for you. Apparently, your version of libfreetype doesn't have the same dependencies as my version. Here, the dependencies are as follows: $ otool -L /opt/local/lib/libfreetype.6.dylib /opt/local/lib/libfreetype.6.dylib: /opt/local/lib/libfreetype.6.dylib (compatibility version 10.0.0, current version 10.20.0) /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 18.0.0) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 22.0.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9) So in the setup script around line 320 where the _imagingft extension module is defined, I added the following linker args: extra_link_args=["-framework", "CoreServices", "-framework", "ApplicationServices"] After that I can actually import _imagingft just on its own and your test script then also works (after changing the font as the one in the script doesn't exist on my system). Without the above modification, your script would still fail unless I import _imagingtk first. So all the dependencies of the PIL modules are now like this: $ otool -L PIL/*.so PIL/_imaging.so: /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9) PIL/_imagingcms.so: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9) PIL/_imagingft.so: /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 18.0.0) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 22.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9) PIL/_imagingmath.so: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9) PIL/_imagingtk.so: /System/Library/Frameworks/Tcl.framework/Versions/8.4/Tcl (compatibility version 8.4.0, current version 8.4.0) /System/Library/Frameworks/Tk.framework/Versions/8.4/Tk (compatibility version 8.4.0, current version 8.4.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9) So do all Python modules compiled on OSX 10.4 automatically work on newer versions of OSX? Do you want me to send the packages to you for testing? By the way, what's generally the preferred distribution format, zip or dmg? - Matthias - From Chris.Barker at noaa.gov Sun Jun 6 20:11:54 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Sun, 06 Jun 2010 11:11:54 -0700 Subject: [Image-SIG] [Pythonmac-SIG] PIL binaries -- please test In-Reply-To: <4C0BE143.4070704@gmail.com> References: <4BFC2BA8.6040809@noaa.gov> <1274858227.6918.10.camel@mypride> <4BFD6148.8000407@noaa.gov> <4C0A8459.2090202@gmail.com> <4C0A87CE.5090902@noaa.gov> <4C0A9BDB.9050403@gmail.com> <4C0AA9F8.1030908@noaa.gov> <4C0BE143.4070704@gmail.com> Message-ID: <4C0BE4EA.9020609@noaa.gov> Matthias Baas wrote: > Apparently, your version of libfreetype doesn't > have the same dependencies as my version. Here, the dependencies are as > follows: > > $ otool -L /opt/local/lib/libfreetype.6.dylib > /opt/local/lib/libfreetype.6.dylib: > /opt/local/lib/libfreetype.6.dylib (compatibility version 10.0.0, > current version 10.20.0) > /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices > (compatibility version 1.0.0, current version 18.0.0) > /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices > (compatibility version 1.0.0, current version 22.0.0) > /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version > 1.0.0) > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current > version 88.3.9) Interesting -- mine are: $ otool -L /opt/local/lib/libfreetype.dylib /opt/local/lib/libfreetype.dylib: /opt/local/lib/libfreetype.6.dylib (compatibility version 11.0.0, current version 11.0.0) /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.5) so none of the CoreServices stuff - maybe a 10.4 vs. 1.5 difference. > So in the setup script around line 320 where the _imagingft extension > module is defined, I added the following linker args: > > extra_link_args=["-framework", "CoreServices", "-framework", > "ApplicationServices"] > > After that I can actually import _imagingft just on its own and your > test script then also works nice work! > So all the dependencies of the PIL modules are now like this: those look reasonable. > PIL/_imagingtk.so: > /System/Library/Frameworks/Tcl.framework/Versions/8.4/Tcl > (compatibility version 8.4.0, current version 8.4.0) > /System/Library/Frameworks/Tk.framework/Versions/8.4/Tk > (compatibility version 8.4.0, current version 8.4.0) > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current > version 88.3.9) I'm not sure what the deal is with this -- there are issue with different TK versions, but I dont us TK, so I'mve never figured that out. > So do all Python modules compiled on OSX 10.4 automatically work on > newer versions of OSX? In theory, yes. > Do you want me to send the packages to you for > testing? Please put them on a publicly accessible site if you can, and sent a note tho these lists asking for testing. If you don't have anywhere to put them, you can open a Dropbox account, or soemthing else, or send them to me and I'll put them on mine. > By the way, what's generally the preferred distribution format, > zip or dmg? I suppose dmg is a little better, but either one is fine. Thanks for all this work! -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (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 j.bakker at atmind.nl Wed Jun 9 13:09:28 2010 From: j.bakker at atmind.nl (Jeroen Bakker) Date: Wed, 09 Jun 2010 13:09:28 +0200 Subject: [Image-SIG] Status Message-ID: <4C0F7668.5070106@atmind.nl> An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: logo80x80.gif Type: image/gif Size: 3420 bytes Desc: not available URL: From jlu at hep.anl.gov Sun Jun 13 01:03:12 2010 From: jlu at hep.anl.gov (Jack Uretsky) Date: Sat, 12 Jun 2010 18:03:12 -0500 (CDT) Subject: [Image-SIG] Installing libjpeg In-Reply-To: References: Message-ID: Hi- I'm a newcomer, about to try to install PIL. I'm running OS X snow leopard pm am intel Mac. I'm at the point where I've downloaded the 4 files mentioned in the README ( libjpeg62 zlib1g libfreetype6 liblcmsl) but don't know what to do with them. Pls help me complete the install Regards, Jack Uretsky "Trust me. I have a lot of experience at this." General Custer's unremembered message to his men, just before leading them into the Little Big Horn Valley From Chris.Barker at noaa.gov Sun Jun 13 03:36:41 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Sat, 12 Jun 2010 18:36:41 -0700 Subject: [Image-SIG] Installing libjpeg In-Reply-To: References: Message-ID: <4C143629.8020302@noaa.gov> Jack Uretsky wrote: > Hi- > I'm a newcomer, about to try to install PIL. I'm running OS X snow > leopard pm am intel Mac. I'm at the point where I've downloaded the 4 > files mentioned in the README ( > libjpeg62 > zlib1g > libfreetype6 > liblcmsl) > but don't know what to do with them. I suggest one of two options: 1) Use the python.org python, and the binary recently posted to this list. 2) use macports to compile the dependencies: a) install macports b) $ sudo port install libjpeg c) $ sudo port install lcms d) $ sudo port install freetype e) python setup.py build f) python setup.pyu install -CHB -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (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 jlu at hep.anl.gov Mon Jun 14 06:45:41 2010 From: jlu at hep.anl.gov (Jack Uretsky) Date: Sun, 13 Jun 2010 23:45:41 -0500 (CDT) Subject: [Image-SIG] Installing libjpeg In-Reply-To: <4C143629.8020302@noaa.gov> References: <4C143629.8020302@noaa.gov> Message-ID: Thanks. I believe I have Macports installed. Here's what I get on the first command: Macintosh-2:~ jackuretsky$ sudo port install libjpeg Password: sudo: port: command not found Further suggestions? Regards, Jack "Trust me. I have a lot of experience at this." General Custer's unremembered message to his men, just before leading them into the Little Big Horn Valley On Sat, 12 Jun 2010, Christopher Barker wrote: > Jack Uretsky wrote: >> Hi- >> I'm a newcomer, about to try to install PIL. I'm running OS X snow >> leopard pm am intel Mac. I'm at the point where I've downloaded the 4 >> files mentioned in the README ( >> libjpeg62 >> zlib1g >> libfreetype6 >> liblcmsl) >> but don't know what to do with them. > > I suggest one of two options: > > 1) Use the python.org python, and the binary recently posted to this list. > > > 2) use macports to compile the dependencies: > > a) install macports > b) $ sudo port install libjpeg > c) $ sudo port install lcms > d) $ sudo port install freetype > > e) python setup.py build > f) python setup.pyu install > > > > -CHB > > > > > -- > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (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 yury at shurup.com Mon Jun 14 10:38:39 2010 From: yury at shurup.com (Yury V. Zaytsev) Date: Mon, 14 Jun 2010 10:38:39 +0200 Subject: [Image-SIG] Installing libjpeg In-Reply-To: References: <4C143629.8020302@noaa.gov> Message-ID: <1276504719.7686.5.camel@mypride> On Sun, 2010-06-13 at 23:45 -0500, Jack Uretsky wrote: > Thanks. I believe I have Macports installed. Here's what I get on the > first command: > > Macintosh-2:~ jackuretsky$ sudo port install libjpeg > Password: > sudo: port: command not found > > Further suggestions? I bet you don't. Any reason to not to use Chris' binaries? http://packages.zaytsev.net/python/ -- Sincerely yours, Yury V. Zaytsev From jlu at hep.anl.gov Mon Jun 14 20:10:30 2010 From: jlu at hep.anl.gov (Jack Uretsky) Date: Mon, 14 Jun 2010 13:10:30 -0500 (CDT) Subject: [Image-SIG] Installing libjpeg In-Reply-To: <1276504719.7686.5.camel@mypride> References: <4C143629.8020302@noaa.gov> <1276504719.7686.5.camel@mypride> Message-ID: Thanks. I'll check Macports again. I wasn't sure where to find the binaries. Regards, Jack "Trust me. I have a lot of experience at this." General Custer's unremembered message to his men, just before leading them into the Little Big Horn Valley On Mon, 14 Jun 2010, Yury V. Zaytsev wrote: > On Sun, 2010-06-13 at 23:45 -0500, Jack Uretsky wrote: >> Thanks. I believe I have Macports installed. Here's what I get on the >> first command: >> >> Macintosh-2:~ jackuretsky$ sudo port install libjpeg >> Password: >> sudo: port: command not found >> >> Further suggestions? > > I bet you don't. Any reason to not to use Chris' binaries? > > http://packages.zaytsev.net/python/ > > -- > Sincerely yours, > Yury V. Zaytsev > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From ravs at fisica.ucr.ac.cr Thu Jun 17 08:04:42 2010 From: ravs at fisica.ucr.ac.cr (Reymer Antonio Vargas Solano) Date: Thu, 17 Jun 2010 00:04:42 -0600 Subject: [Image-SIG] McIdas Image Plugin In-Reply-To: References: Message-ID: Hello I trying to use the McIdasImagePlugin.py, We have a lot of old McIdas area files on some disc, and we are trying to get information about the files. so I'm trying to write an script get information about the files, for e.g the original date, and the band of the image, but I need help, do you have the "README" file of the plugin?? or some idea to get the information.. Thanks Reymer Vargas School of Physics University of Costa Rica -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik at pythonware.com Thu Jun 17 14:19:15 2010 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 17 Jun 2010 14:19:15 +0200 Subject: [Image-SIG] McIdas Image Plugin In-Reply-To: References: Message-ID: 2010/6/17 Reymer Antonio Vargas Solano : > Hello > > ?I trying to use the McIdasImagePlugin.py, We have a lot of old McIdas area > files on some disc, and we are trying to get information about the files. so > I'm trying to write an script get information about the files, for e.g the > original date, and the band of the image, but I need help, do you have the > "README" file of the plugin?? or some idea to get the information.. The module is part of the PIL library. Just open the files as usual, and inspect the image properties: >>> from PIL import Image >>> im = Image.open("some mcidas file") >>> print im.mode >>> print im.size >>> print im.info >>> im.save("copy.png") Note that it's a very basic reader; it only supports basic 8/16/32-bit images, and I don't think it extracts any metadata beyond pixel format and size. From jlu at hep.anl.gov Fri Jun 18 00:09:53 2010 From: jlu at hep.anl.gov (Jack Uretsky) Date: Thu, 17 Jun 2010 17:09:53 -0500 (CDT) Subject: [Image-SIG] Snow Leopard; PIL Message-ID: Hi- Is there presently a binary of PIL (1.1.7?) that will run on OS X Snow Leopard? I find the archive a bit confusing. Regards, Jack "Trust me. I have a lot of experience at this." General Custer's unremembered message to his men, just before leading them into the Little Big Horn Valley From aclark at aclark.net Fri Jun 18 01:02:52 2010 From: aclark at aclark.net (Alex Clark) Date: Thu, 17 Jun 2010 19:02:52 -0400 Subject: [Image-SIG] Snow Leopard; PIL References: Message-ID: Hi, On Thu, 17 Jun 2010 18:09:53 -0400, Jack Uretsky wrote: > Hi- > Is there presently a binary of PIL (1.1.7?) that will run on OS X Snow > Leopard? I find the archive a bit confusing. Why not just compile it? I think all you need is XCode? or worst case you may need to add some jpeg libs (and Tk, PNG, etc.) via MacPorts. > Regards, > Jack > > "Trust me. I have a lot of experience at this." > General Custer's unremembered message to his men, > just before leading them into the Little Big Horn Valley > > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > -- Alex Clark ? http://aclark.net Author ? Plone 3.3 Site Administration ? http://aclark.net/admin From ext-nam.vuhoang at capricode.com Fri Jun 18 09:29:56 2010 From: ext-nam.vuhoang at capricode.com (Nam Vu Hoang) Date: Fri, 18 Jun 2010 10:29:56 +0300 Subject: [Image-SIG] Python Imaging Library for Windows Mobile Message-ID: <4C1B2074.5090100@capricode.com> Hello, I'd like to ask you if there is any PIL support for WM or not? Thank you and best regards, Nam From jlu at hep.anl.gov Sat Jun 19 00:24:55 2010 From: jlu at hep.anl.gov (Jack Uretsky) Date: Fri, 18 Jun 2010 17:24:55 -0500 (CDT) Subject: [Image-SIG] Snow Leopard; PIL In-Reply-To: References: Message-ID: I am following the README that comes with PIL 1.1.7 I get the following, when I do "python setup.py build_ext -i (I note the "please check your xcode installation"..I reinstalled in from the Snow Leopard disk _________________________________________________________________ MacOS/Python: can't open file 'setp.py': [Errno 2] No such file or directory Macintosh-2:Imaging-1.1.7 jackuretsky$ python setup.py build_ext -i running build_ext --- using frameworks at /System/Library/Frameworks building '_imaging' extension Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/MacOSX10.4u.sdk Please check your Xcode installation gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/opt/local/include/freetype2 -IlibImaging -I/sw/include -I/opt/local/include -I/Library/Frameworks/Python.framework/Versions/2.6/include -I/usr/local/include -I/usr/include -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _imaging.c -o build/temp.macosx-10.3-fat-2.6/_imaging.o In file included from /usr/include/math.h:26, from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyport.h:235, from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:58, from _imaging.c:75: /usr/include/architecture/ppc/math.h:666: warning: conflicting types for built-in function ?scalb? In file included from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/unicodeobject.h:4, from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:85, from _imaging.c:75: /usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory _imaging.c:3017: warning: initialization from incompatible pointer type _imaging.c:3077: warning: initialization from incompatible pointer type In file included from /usr/include/architecture/i386/math.h:626, from /usr/include/math.h:28, from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyport.h:235, from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:58, from _imaging.c:75: /usr/include/AvailabilityMacros.h:108:14: warning: #warning Building for Intel with Mac OS X Deployment Target < 10.4 is invalid. In file included from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/unicodeobject.h:4, from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:85, from _imaging.c:75: /usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory _imaging.c:3017: warning: initialization from incompatible pointer type _imaging.c:3077: warning: initialization from incompatible pointer type lipo: can't figure out the architecture type of: /var/folders/Rr/RrEV8+QRGCq5fsG4i5qJE++++TI/-Tmp-//ccaXyEIG.out error: command 'gcc' failed with exit status 1 __________________________________________________________ Evidently, I need help. Please. Regards, Jack Uretsky "Trust me. I have a lot of experience at this." General Custer's unremembered message to his men, just before leading them into the Little Big Horn Valley From jlu at hep.anl.gov Sat Jun 19 19:30:20 2010 From: jlu at hep.anl.gov (Jack Uretsky) Date: Sat, 19 Jun 2010 12:30:20 -0500 (CDT) Subject: [Image-SIG] Python Imaging Library for Windows Mobile In-Reply-To: <4C1B2074.5090100@capricode.com> References: <4C1B2074.5090100@capricode.com> Message-ID: Hi- Sorry for the delay. I'm the wrong person to ask. I don't even know what WM is. Regards, Jack "Trust me. I have a lot of experience at this." General Custer's unremembered message to his men, just before leading them into the Little Big Horn Valley On Fri, 18 Jun 2010, Nam Vu Hoang wrote: > Hello, > > I'd like to ask you if there is any PIL support for WM or not? > > Thank you and best regards, > Nam > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From Chris.Barker at noaa.gov Sat Jun 19 23:52:32 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Sat, 19 Jun 2010 14:52:32 -0700 Subject: [Image-SIG] Snow Leopard; PIL In-Reply-To: References: Message-ID: <4C1D3C20.4060708@noaa.gov> Jack Uretsky wrote: > Is there presently a binary of PIL (1.1.7?) that will run on OS X > Snow Leopard? I find the archive a bit confusing. See the thread on this list in the last few weeks entitled: "PIL binaries -- please test" -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (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 jlu at hep.anl.gov Sun Jun 20 01:57:57 2010 From: jlu at hep.anl.gov (Jack Uretsky) Date: Sat, 19 Jun 2010 18:57:57 -0500 (CDT) Subject: [Image-SIG] building PIL in Snow Leopard Message-ID: Hi- When I do "python setup.py buil_ext -i" The response starts with _____________________________________ I am following the README that comes with PIL 1.1.7 I get the following, when I do "python setup.py build_ext -i (I note the "please check your xcode installation"..I reinstalled in from the Snow Leopard disk _________________________________________________________________ MacOS/Python: can't open file 'setp.py': [Errno 2] No such file or directory Macintosh-2:Imaging-1.1.7 jackuretsky$ python setup.py build_ext -i running build_ext --- using frameworks at /System/Library/Frameworks building '_imaging' extension Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/MacOSX10.4u.sdk _______________________________ and, sure enough, there is no MacOSX10.4u.sdk in my SDK directory. Something that i am invoking seems out of date becouse Snow Leopard is MACOSX 10.6, which I've just updated to 10.4 Any insights? Regards, Jack "Trust me. I have a lot of experience at this." General Custer's unremembered message to his men, just before leading them into the Little Big Horn Valley From Chris.Barker at noaa.gov Sun Jun 20 03:30:26 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Sat, 19 Jun 2010 18:30:26 -0700 Subject: [Image-SIG] building PIL in Snow Leopard In-Reply-To: References: Message-ID: <4C1D6F32.90706@noaa.gov> Jack Uretsky wrote: > Macintosh-2:Imaging-1.1.7 jackuretsky$ python setup.py build_ext -i > running build_ext > --- using frameworks at /System/Library/Frameworks > building '_imaging' extension > Compiling with an SDK that doesn't seem to exist: > /Developer/SDKs/MacOSX10.4u.sdk > _______________________________ > and, sure enough, there is no MacOSX10.4u.sdk in my SDK directory. > Something that i am invoking seems out of date becouse Snow Leopard > is MACOSX 10.6, which I've just updated to 10.4 > Any insights? > Regards, > Jack It looks like you are building with the python.org Python, correct? It is build to work on older systems, thus the MacOSX10.4u.sdk requirement. That sdk is an optional install with XCode -- if you go back to the XCode installer, you should be able to find a way to add it (sorry, it's been a while, I don't remember exatly how...) But you can probably use the binaries here, if you like: http://dl.dropbox.com/u/855965/PIL-OSX-Binaries/PIL-1.1.7-py2.5-macosx10.5.mpkg.zip http://dl.dropbox.com/u/855965/PIL-OSX-Binaries/PIL-1.1.7-py2.6-macosx10.5.mpkg.zip -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (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 fredrik at pythonware.com Sun Jun 20 17:48:16 2010 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 20 Jun 2010 17:48:16 +0200 Subject: [Image-SIG] Getting PIL to work on OSX Snow Leopard In-Reply-To: References: <4C0A8636.4020601@noaa.gov> Message-ID: 2010/6/5 Simon Mosk-Aoyama : > Chris, > Thanks so much for the suggestion! > I ran the otool command and noted that the _imaging.so is linked to the > wrong (newer) libjpeg: > > simon@/Users/simon/: otool -L PIL/_imaging.so > PIL/_imaging.so: > ?? ? ? ?/opt/local/lib/libjpeg.8.dylib (compatibility version 9.0.0, current > version 9.1.0) > ?? ? ? ?/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current > version 1.2.5) > ?? ? ? ?/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current > version 125.0.1) > > so seems like I may have misconfigured setup.py. According to my tests, PIL works just fine with libjpeg verions 7 and 8 (there's been a bit of version inflation over there lately :-). I guess you could get into trouble if you build with header files for libjpeg 6 and then link the result against libjpeg 7/8, but I have no idea if that's the case. From fredrik at pythonware.com Sun Jun 20 17:51:18 2010 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 20 Jun 2010 17:51:18 +0200 Subject: [Image-SIG] Python Imaging Library for Windows Mobile In-Reply-To: <4C1B2074.5090100@capricode.com> References: <4C1B2074.5090100@capricode.com> Message-ID: I'm not aware of any ports. In fact, I'm not aware of any current ports of Python itself to that platform (there are some older projects, but they seem pretty stale). In general, PIL works everywhere you have Python and a working C compiler / C runtime environment (even if building it might take some work). No idea if you have all that on Windows Mobile, though. 2010/6/18 Nam Vu Hoang : > Hello, > > I'd like to ask you if there is any PIL support for WM or not? > > Thank you and best regards, > Nam > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From jlu at hep.anl.gov Sun Jun 20 19:14:29 2010 From: jlu at hep.anl.gov (Jack Uretsky) Date: Sun, 20 Jun 2010 12:14:29 -0500 (CDT) Subject: [Image-SIG] building PIL in Snow Leopard In-Reply-To: <4C1D6F32.90706@noaa.gov> References: <4C1D6F32.90706@noaa.gov> Message-ID: Thank you very much.. I note that neither binary is for Snow Leopard (OSX 10.6) I'll try the pthon 2.6 veersion, nevertheless. Regards, Jack "Trust me. I have a lot of experience at this." General Custer's unremembered message to his men, just before leading them into the Little Big Horn Valley On Sat, 19 Jun 2010, Christopher Barker wrote: > Jack Uretsky wrote: >> Macintosh-2:Imaging-1.1.7 jackuretsky$ python setup.py build_ext -i >> running build_ext >> --- using frameworks at /System/Library/Frameworks >> building '_imaging' extension >> Compiling with an SDK that doesn't seem to exist: >> /Developer/SDKs/MacOSX10.4u.sdk >> _______________________________ >> and, sure enough, there is no MacOSX10.4u.sdk in my SDK directory. >> Something that i am invoking seems out of date becouse Snow Leopard >> is MACOSX 10.6, which I've just updated to 10.4 >> Any insights? >> Regards, >> Jack > > It looks like you are building with the python.org Python, correct? It is > build to work on older systems, thus the MacOSX10.4u.sdk requirement. That > sdk is an optional install with XCode -- if you go back to the XCode > installer, you should be able to find a way to add it (sorry, it's been a > while, I don't remember exatly how...) > > But you can probably use the binaries here, if you like: > > http://dl.dropbox.com/u/855965/PIL-OSX-Binaries/PIL-1.1.7-py2.5-macosx10.5.mpkg.zip > > http://dl.dropbox.com/u/855965/PIL-OSX-Binaries/PIL-1.1.7-py2.6-macosx10.5.mpkg.zip > > -Chris > > > > > > > -- > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (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 > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From jlu at hep.anl.gov Sun Jun 20 22:44:11 2010 From: jlu at hep.anl.gov (Jack Uretsky) Date: Sun, 20 Jun 2010 15:44:11 -0500 (CDT) Subject: [Image-SIG] building PIL in Snow Leopard In-Reply-To: <4C1D6F32.90706@noaa.gov> References: <4C1D6F32.90706@noaa.gov> Message-ID: Hi Thanks very much. Not only does the binary seem to work beautifully, but you've introduced me to drop box. I hope to have a little show on my homepage, with the aid of this feature, but it may take a few days. Regards, Jack (who did some consulting Oceanography in the San Diego area back in the 'sixties) "Trust me. I have a lot of experience at this." General Custer's unremembered message to his men, just before leading them into the Little Big Horn Valley On Sat, 19 Jun 2010, Christopher Barker wrote: > Jack Uretsky wrote: >> Macintosh-2:Imaging-1.1.7 jackuretsky$ python setup.py build_ext -i >> running build_ext >> --- using frameworks at /System/Library/Frameworks >> building '_imaging' extension >> Compiling with an SDK that doesn't seem to exist: >> /Developer/SDKs/MacOSX10.4u.sdk >> _______________________________ >> and, sure enough, there is no MacOSX10.4u.sdk in my SDK directory. >> Something that i am invoking seems out of date becouse Snow Leopard >> is MACOSX 10.6, which I've just updated to 10.4 >> Any insights? >> Regards, >> Jack > > It looks like you are building with the python.org Python, correct? It is > build to work on older systems, thus the MacOSX10.4u.sdk requirement. That > sdk is an optional install with XCode -- if you go back to the XCode > installer, you should be able to find a way to add it (sorry, it's been a > while, I don't remember exatly how...) > > But you can probably use the binaries here, if you like: > > http://dl.dropbox.com/u/855965/PIL-OSX-Binaries/PIL-1.1.7-py2.5-macosx10.5.mpkg.zip > > http://dl.dropbox.com/u/855965/PIL-OSX-Binaries/PIL-1.1.7-py2.6-macosx10.5.mpkg.zip > > -Chris > > > > > > > -- > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (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 > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From info at tulix.de Mon Jun 21 19:37:31 2010 From: info at tulix.de (Jens Heidrich) Date: Mon, 21 Jun 2010 19:37:31 +0200 Subject: [Image-SIG] write Tiff Tags Message-ID: <20100621173731.GA8800@metal.heidrich.local> Hello, I'm new to this list and searching for information how to save tags in multipage TIFF-Images using PIL. I use ImageMagick to merge some TIFF-images into one single file und want to set the tag 269 (Document Name) to the name of the included images. I use PIL to read the multipage image and can extract the tags set by ImageMagick. I set the tag "Document Name" for each image in the file. But when I save the file, my tag-changes are lost. Thanks in advance, Jens -- tulix - arts & engineering Jens Heidrich Volkmannsdorf 25 07422 Saalfelder H?he Web: http://www.tulix.de E-Mail: info at tulix.de Tel. +49 36736 23 236 Fax +49 36736 23 899 Mobil +49 173 696 696 9 Ust-IdNr. DE255443889 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 163 bytes Desc: Digital signature URL: From ioannis87 at gmail.com Tue Jun 22 16:56:37 2010 From: ioannis87 at gmail.com (ioannis syntychakis) Date: Tue, 22 Jun 2010 07:56:37 -0700 Subject: [Image-SIG] get values of known positions on Image Message-ID: hello everybody, I hope somebody can help me with this: I have an grayscale image. In this image iam looking voor values above the 200. (numpy.where) the result is this: (array([30, 30, 30, ..., 70, 70, 70]), array([35, 36, 37, ..., 34, 35, 36])) these are the positions of the pixels with a value above the 200. But I don't want to have the positions, but the pixelvalues where the pixels are above the 200. So, i have the positions but i want tot know what the values are on these positions. anyone can help me please? I have searched a lot, but found nothing. thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chris.Barker at noaa.gov Wed Jun 23 19:00:06 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 23 Jun 2010 10:00:06 -0700 Subject: [Image-SIG] get values of known positions on Image In-Reply-To: References: Message-ID: <4C223D96.1040401@noaa.gov> ioannis syntychakis wrote: > But I don't want to have the positions, but the pixelvalues where the > pixels are above the 200. there may be a way to do this directly with PIL, but with numpy: In [13]: a Out[13]: array([1, 7, 3, 4, 9, 5, 7, 8, 5]) In [14]: a[a > 4] Out[14]: array([7, 9, 5, 7, 8, 5]) For more details and options, see the numpy docs and/or ask on the numpy list. -CHB -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (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 olt at bogosoft.com Wed Jun 23 19:15:33 2010 From: olt at bogosoft.com (Oliver Tonnhofer) Date: Wed, 23 Jun 2010 19:15:33 +0200 Subject: [Image-SIG] New fast quantizer for PIL Message-ID: <943F455E-83DB-4A23-AD1E-556C290C4D17@bogosoft.com> Hi everyone, I tried to improve the performance of the existing PIL image quantizer, but the best improvements I got were only 10%. While investigating how the median cut algorithm works, I came across the octree color quantization algorithm. I've implemented a variation of this algorithm and the results are very impressive. It shows up-to-10x improvements. The algorithm shows good image quality for rasterized vector images like maps; gradients do not look as good as with the median cut algorithm. For our use case[0], serving maps, we get an overall performance boots of ~x3.5. Here are some times in ms, best of 5 runs. rgb adaptive octree octree+rle jpeg baboon.jpg 122.42 403.77 34.76 20.71 16.35 gradient.png 1.45 6.60 1.01 1.21 0.95 lena.jpg 167.83 325.08 35.53 19.26 13.11 map.png 194.42 305.59 89.83 37.78 34.59 rainbow.png 11.84 229.73 3.83 3.74 3.13 wiki-en.png 7.27 12.45 2.78 1.65 1.81 All times include a convert/quantize and save call. - rgb is a plain save - adaptive is `convert('P', palette=ADAPTIVE)` - octree the new algorithm - octree+rle the new algorithm with RLE encoding enabled with my compress_type patch[1] The images are online [2], and there is also a .tar.gz with all images to download. The new quantizer is available at bitbucket[3]. You can use the new algorithm with `img.convert(256, 2)`. I'd love to see that in the next PIL release. I will add some more comments and will clean up the code a bit more, then I'm up for a code review. Comments are welcomed already, though. [0] http://osm.omniscale.de/ http://mapproxy.org [1] http://bitbucket.org/olt/pil-117/changeset/8d4661695edd [2] http://bogosoft.com/misc/pil-octree-tests/ [3] http://bitbucket.org/olt/pil-117-octree Regards, Oliver From wrybread at gmail.com Mon Jun 28 16:29:59 2010 From: wrybread at gmail.com (Alec Bennett) Date: Mon, 28 Jun 2010 07:29:59 -0700 Subject: [Image-SIG] When to use antialiasing when resizing? Message-ID: I'm wondering if there's some general rule as to when to use the Antialias filter when resizing an image? It seems that logo type images benefit greatly from it, but regular pictures get less of a benefit? I recently discovered that Atom-processor netbooks have a very hard time with antialiasing, so I'm trying to use it sparingly. -------------- next part -------------- An HTML attachment was scrubbed... URL: From edward at unicornschool.org Tue Jun 29 19:32:35 2010 From: edward at unicornschool.org (Edward Cannon) Date: Tue, 29 Jun 2010 10:32:35 -0700 Subject: [Image-SIG] When to use antialiasing when resizing? In-Reply-To: References: Message-ID: I tend to do it all the time, but that's just me. You could try using the Bilinear Filter instead, often that works just fine. On Mon, Jun 28, 2010 at 7:29 AM, Alec Bennett wrote: > I'm wondering if there's some general rule as to when to use the Antialias > filter when resizing an image? > > It seems that logo type images benefit greatly from it, but regular pictures > get less of a benefit? > > I recently discovered that Atom-processor netbooks have a very hard time > with antialiasing, so I'm trying to use it sparingly. > > > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > From cannon.el at gmail.com Wed Jun 30 17:59:44 2010 From: cannon.el at gmail.com (Edward Cannon) Date: Wed, 30 Jun 2010 08:59:44 -0700 Subject: [Image-SIG] When to use antialiasing when resizing? In-Reply-To: References: Message-ID: <79F59584-B038-40C9-9238-E8B94AEB0F92@gmail.com> The default is specified in the documentation, usually NEAREST On Jun 29, 2010, at 6:21 PM, Alec Bennett wrote: > I use antialiasing all the time too. But wow, try it on an Atom > processor (i.e. netbook) sometime, very very very slow. > > When no filter is specified, does it use the Bilinear filter? > > From chris.mit7 at gmail.com Wed Jun 30 00:16:00 2010 From: chris.mit7 at gmail.com (Chris Mitchell) Date: Tue, 29 Jun 2010 18:16:00 -0400 Subject: [Image-SIG] TIFF images loaded as 15 bit signed integers Message-ID: Hey everyone, I've run into a problem where using: im = Image.open(file) data = im.getdata() results in data having negative values for pixels exceeding 32768. im.mode gives I;16B. I'm thinking maybe the file is really little endian and perhaps this is why I'm getting negative values. Anyone ever have this situation occurr before? -------------- next part -------------- An HTML attachment was scrubbed... URL: From wrybread at gmail.com Wed Jun 30 03:21:14 2010 From: wrybread at gmail.com (Alec Bennett) Date: Tue, 29 Jun 2010 18:21:14 -0700 Subject: [Image-SIG] When to use antialiasing when resizing? In-Reply-To: References: Message-ID: I use antialiasing all the time too. But wow, try it on an Atom processor (i.e. netbook) sometime, very very very slow. When no filter is specified, does it use the Bilinear filter? -------------- next part -------------- An HTML attachment was scrubbed... URL: