From chris.lyon@tgm.co.uk Fri Jan 4 16:30:12 2002 From: chris.lyon@tgm.co.uk (chris lyon) Date: Fri, 4 Jan 2002 16:30:12 -0000 Subject: [Image-SIG] Python Newbie with a Python Imaging Library installation issue Message-ID: <003301c1953d$1540da80$ea0810ac@toshiba> This is a multi-part message in MIME format. ------=_NextPart_000_0030_01C1953D.153011A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am new to python and am chewing my way throu Mark Lutz and David = Ascher's Learning Python. Upon reaching chapter 10 'Frameworks and Applications' It mentions the = Python Imaging Library (PIL) This would seem to address perfectly what I am attempting to achieve, = which is drawing graphs in a format that can be made available as an = image in an html page. I have downloaded the package but do not know how I am meant to make the = import functions available to python=20 every time I try to load the module 'viewer.py' the interactive window = reports... File "C:\Python21\Pythonwin\pywin\framework\scriptutils.py", line 394, = in ImportFile exec codeObj in __main__.__dict__ File "", line 1, in ? File ".\viewer.py", line 7, in ? import Image, ImageTk ImportError: No module named Image It can't find the image module but how am I meant to install this = seemlessly on Windows? I'm sorry this is such a mundane question but I really would like so = solve this in an approved fashion rather than just wantonly copying = files until majic happens and faith is destroyed Chris Lyon chris.lyon@tgm.co.uk ------=_NextPart_000_0030_01C1953D.153011A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I am new to python and am chewing my = way throu Mark=20 Lutz and David Ascher's Learning Python.
Upon reaching chapter 10 'Frameworks = and=20 Applications' It mentions the Python Imaging Library (PIL)
 
This would seem to address perfectly = what I am=20 attempting to achieve, which is drawing graphs in a format that can be = made=20 available as an image in an html page.
I have downloaded the package but do = not know how I=20 am meant to make the import functions available to python
every time I try to load the module = 'viewer.py' the=20 interactive window reports...
 
  File=20 "C:\Python21\Pythonwin\pywin\framework\scriptutils.py", line 394, in=20 ImportFile
    exec codeObj in = __main__.__dict__
 =20 File "<auto import>", line 1, in ?
  File ".\viewer.py", = line 7,=20 in ?
    import Image, ImageTk
ImportError: No = module named=20 Image
 
It can't find the image module but how = am I meant=20 to install this seemlessly on Windows?
I'm sorry this is such a mundane = question but I=20 really would like so solve this in an approved fashion rather than just = wantonly=20 copying files until majic happens and faith is destroyed
 
 
Chris Lyon
chris.lyon@tgm.co.uk
------=_NextPart_000_0030_01C1953D.153011A0-- From fredrik@pythonware.com Mon Jan 7 19:48:58 2002 From: fredrik@pythonware.com (Fredrik Lundh) Date: Mon, 7 Jan 2002 20:48:58 +0100 Subject: [Image-SIG] Python Newbie with a Python Imaging Library installation issue References: <003301c1953d$1540da80$ea0810ac@toshiba> Message-ID: <016801c197b4$5e6eed40$ced241d5@hagrid> chris wrote: > ImportError: No module named Image > It can't find the image module but how am I meant > to install this seemlessly on Windows? this might help: http://mail.python.org/pipermail/image-sig/2001-December/001691.html From s.freud@teleline.es Tue Jan 8 19:18:34 2002 From: s.freud@teleline.es (Sinule) Date: Tue, 8 Jan 2002 20:18:34 +0100 Subject: [Image-SIG] Some question abaut PIL image library Message-ID: <000801c19879$45914e60$f7b3aad4@gandalf> This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C19881.A6385F80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I would like to Know that PIL image library is avaiable under C++ = interface. In all case I am interested and I would like to recive more = informacion about library. Thank you very much. ------=_NextPart_000_0005_01C19881.A6385F80 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello, I would like to Know that PIL = image library=20 is avaiable under C++ interface. In all case I am interested and=20 I would like to recive more informacion about = library.
 
Thank you very = much.
------=_NextPart_000_0005_01C19881.A6385F80-- From runping.qi@propel.com Mon Jan 14 21:11:26 2002 From: runping.qi@propel.com (Runping Qi) Date: Mon, 14 Jan 2002 13:11:26 -0800 Subject: [Image-SIG] PIL jpeg compression Message-ID: Hi, I am using PIL to reduce jpeg data size by saving out with lower quality value (most time quality = 50). I wonder whether there are any tricks that can speed up the processing throughput. Thanks a lot in advance. Runping From sherwin@nlm.nih.gov Tue Jan 15 16:27:06 2002 From: sherwin@nlm.nih.gov (Ziying Sherwin) Date: Tue, 15 Jan 2002 11:27:06 -0500 (EST) Subject: [Image-SIG] Error building PIL 1.1.2 dynamic library on Solaris 2.8 with gcc 3.0 Message-ID: We tried to build Python Imaging Library(PIL 1.1.2) with Python 2.1.1 and gcc 3.0 on our Solaris 2.8 machine. Everything went on smoothly until when we tried to build dynamic library at the top level directory. We got the following error messages: gcc -shared ./_imaging.o ./decode.o ./encode.o ./map.o ./display.o ./outline.o ./path.o libImaging/libImaging.a -L/depot/lib -ljpeg -L/depot/lib -lz -o ./_imaging.so Text relocation remains referenced against symbol offset in file 0x14c libImaging/libImaging.a(Unpack.o) 0x150 libImaging/libImaging.a(Unpack.o) 0x154 libImaging/libImaging.a(Unpack.o) 0x158 libImaging/libImaging.a(Unpack.o) 0x15c libImaging/libImaging.a(Unpack.o) 0x160 libImaging/libImaging.a(Unpack.o) [...] 0x4b4 /depot/lib/libz.a(inflate.o) 0x4b8 /depot/lib/libz.a(inflate.o) 0x4bc /depot/lib/libz.a(inflate.o) 0x4c0 /depot/lib/libz.a(inflate.o) 0x4c4 /depot/lib/libz.a(inflate.o) [...] ImagingTransformAffine 0x3c38 libImaging/libImaging.a(Geometry.o) ImagingTransformAffine 0x3d68 libImaging/libImaging.a(Geometry.o) ImagingCopy 0x64 libImaging/libImaging.a(Bands.o)ImagingCopy 0xdc libImaging/libImaging.a(Blend.o)[...] .rem 0x44 libImaging/libImaging.a(Offset.o) .rem 0x64 libImaging/libImaging.a(Offset.o) .rem 0xc0 libImaging/libImaging.a(Offset.o) [...] memset 0x1948 libImaging/libImaging.a(Draw.o) memset 0x1b28 libImaging/libImaging.a(Draw.o) memset 0x2080 libImaging/libImaging.a(Draw.o) [...] 0x638 /depot/lib/libz.a(inffast.o) 0x63c /depot/lib/libz.a(inffast.o) 0x8a0 /depot/lib/libz.a(inffast.o) 0x8a4 /depot/lib/libz.a(inffast.o) ld: fatal: relocations remain against allocatable but non-writable sections collect2: ld returned 1 exit status *** Error code 1 make: Fatal error: Command failed for target `_imaging.so' The error messages ran several pages and we have no idea about what is going on. The version of the packages that we use is jpeg 6b and zlib 1.1.3. Does anyone have similiar experience and have solutions? Thanks in advance. Ziying Sherwin P.S. I am not on the mailing list, please send your response to: sherwin@nlm.nih.gov From sherwin@nlm.nih.gov Tue Jan 15 19:16:54 2002 From: sherwin@nlm.nih.gov (Ziying Sherwin) Date: Tue, 15 Jan 2002 14:16:54 -0500 (EST) Subject: [Image-SIG] Re: pil error In-Reply-To: Message-ID: Thanks for the help. Here is the result: 1. We re-installed zlib, but got the same error message while trying to compile pil dynamic library. 2. Then we remove zlib from Setup.in, we again got the loooong error messages except it does not complain about zlib any more. It complains about symbols in libimaging/libImaging.a are "relocations remain against allocatable but non-writable sections" Any ideas? Thanks Ziying Sherwin On Tue, 15 Jan 2002, Calvin wrote: > install libz or remove it from the config file or fix it's path. > > this should be mentioned in the README. > > -calvin > ---------------------------------- Original message: >From sherwin@hume.nlm.nih.gov Tue Jan 15 11:27:22 2002 Date: Tue, 15 Jan 2002 11:27:06 -0500 (EST) From: Ziying Sherwin To: image-sig@python.org Subject: Error building PIL 1.1.2 dynamic library on Solaris 2.8 with gcc 3.0 We tried to build Python Imaging Library(PIL 1.1.2) with Python 2.1.1 and gcc 3.0 on our Solaris 2.8 machine. Everything went on smoothly until when we tried to build dynamic library at the top level directory. We got the following error messages: gcc -shared ./_imaging.o ./decode.o ./encode.o ./map.o ./display.o ./outline.o ./path.o libImaging/libImaging.a -L/depot/lib -ljpeg -L/depot/lib -lz -o ./_imaging.so Text relocation remains referenced against symbol offset in file 0x14c libImaging/libImaging.a(Unpack.o) 0x150 libImaging/libImaging.a(Unpack.o) 0x154 libImaging/libImaging.a(Unpack.o) 0x158 libImaging/libImaging.a(Unpack.o) 0x15c libImaging/libImaging.a(Unpack.o) 0x160 libImaging/libImaging.a(Unpack.o) [...] 0x4b4 /depot/lib/libz.a(inflate.o) 0x4b8 /depot/lib/libz.a(inflate.o) 0x4bc /depot/lib/libz.a(inflate.o) 0x4c0 /depot/lib/libz.a(inflate.o) 0x4c4 /depot/lib/libz.a(inflate.o) [...] ImagingTransformAffine 0x3c38 libImaging/libImaging.a(Geometry.o) ImagingTransformAffine 0x3d68 libImaging/libImaging.a(Geometry.o) ImagingCopy 0x64 libImaging/libImaging.a(Bands.o)ImagingCopy 0xdc libImaging/libImaging.a(Blend.o)[...] .rem 0x44 libImaging/libImaging.a(Offset.o) .rem 0x64 libImaging/libImaging.a(Offset.o) .rem 0xc0 libImaging/libImaging.a(Offset.o) [...] memset 0x1948 libImaging/libImaging.a(Draw.o) memset 0x1b28 libImaging/libImaging.a(Draw.o) memset 0x2080 libImaging/libImaging.a(Draw.o) [...] 0x638 /depot/lib/libz.a(inffast.o) 0x63c /depot/lib/libz.a(inffast.o) 0x8a0 /depot/lib/libz.a(inffast.o) 0x8a4 /depot/lib/libz.a(inffast.o) ld: fatal: relocations remain against allocatable but non-writable sections collect2: ld returned 1 exit status *** Error code 1 make: Fatal error: Command failed for target `_imaging.so' The error messages ran several pages and we have no idea about what is going on. The version of the packages that we use is jpeg 6b and zlib 1.1.3. Does anyone have similiar experience and have solutions? Thanks in advance. Ziying Sherwin P.S. I am not on the mailing list, please send your response to: sherwin@nlm.nih.gov From Alan Stewart Fri Jan 18 20:56:48 2002 From: Alan Stewart (D. Alan Stewart) Date: Fri, 18 Jan 2002 15:56:48 -0500 Subject: [Image-SIG] TIFF photometric imterpretation Message-ID: <3C4845BE.25194.1A2C6A7@localhost> I've had to perform a simple fix on TiffImagePlugin.py at my site: I supplied a default value for the PHOTOMETRIC_INTERPRETATION tag. # photo = self.tag.getscalar(PHOTOMETRIC_INTERPRETATION) # The Aldus TIFF specification says that a photometric intepretation tag # is required, but still some TIFF files do not have it! Supplying a # default, even though the TIFF specification does not assign one, allows # opening slightly illegal TIFF images. - DAS 2001-12-19 photo = self.tag.getscalar(PHOTOMETRIC_INTERPRETATION, 0) I'm using PIL 1.1.2. D. Alan Stewart Layton Graphics, Inc. 155 Woolco Dr. Marietta, GA 30062 Voice: 770/973-4312 Fax: 800/367-8192 FTP: ftp.layton-graphics.com WWW: www.layton-graphics.com "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein From greg.mccall@telstra.com Sun Jan 20 03:33:52 2002 From: greg.mccall@telstra.com (Greg McCall) Date: Sun, 20 Jan 2002 14:33:52 +1100 Subject: [Image-SIG] PIL1.1.2 GIF handling error Message-ID: <001501c1a163$499dff10$bc3d30cb@messageus.com> Hi I get an error when I use a gif file with PIL. No problem with the same gif converted to png Does anyone know how to get GIFs working in PIL 1.1.2? (ie. their seems to be a problem with GifImagePlugin.py) The GIF was generated by Microsoft Word 2000 when it saved the page as a web page and produced a gif for the image on the word page. Details: PIL 1.1.2 Same fault happens under Python 2.1 or 2.2 The following is some of the Traceback FYI img1 = PIL_Image.open(filename) File "C:\Python21\lib\PIL\Image.py", line 945, in open return factory(fp, filename) File "C:\Python21\lib\PIL\ImageFile.py", line 69, in __init__ self._open() File "C:\Python21\lib\PIL\GifImagePlugin.py", line 85, in _open self.seek(0) # get ready to read first frame File "C:\Python21\lib\PIL\GifImagePlugin.py", line 108, in seek self.palette = self.global_palette AttributeError: GifImageFile instance has no attribute 'global_palette' regards Greg ============================================== reply ------ Greg> I get an error when I use a gif file with PIL. No problem with Greg> the same gif converted to png ... Greg> File "C:\Python21\lib\PIL\GifImagePlugin.py", line 108, in seek Greg> self.palette = self.global_palette Greg> AttributeError: GifImageFile instance has no attribute 'global_palette' Greg, It appears your GIF image doesn't have all the properties the PIL code is expecting. In the code for _open it only sets self.global_palette under certain circumstances: if flags & 128: # get global palette self.info["background"] = ord(s[11]) self.global_palette = self.palette =\ ImagePalette.raw("RGB", self.fp.read(3< Hello, i want to generate PDF-documents from multipage tiffs with reportlab which relies on PIL. The reportlab library gets the image data with the function img_obj.tostring(). This function gives back the decoded and uncompressed image. This is not necessary for my purposes. I just need the raw compressed data to embed the image in a PDF file. Is there a function in PIL that I can use for this? greetings Dierk Dierk Hoeppner Universitaetsbibliothek Pockelsstr. 13 D-38106 Braunschweig Germany Tel: +49-531-391-5066 Fax: -5836 E-Mail: d.hoeppner@tu-bs.de From lennart@regebro.nu Mon Jan 21 14:48:06 2002 From: lennart@regebro.nu (Lennart Regebro) Date: Mon, 21 Jan 2002 15:48:06 +0100 Subject: [Image-SIG] Out of ideas: Can't get JPEG to work with PIL. Message-ID: <001401c1a28a$a4c75d00$250aa8c0@torped.se> Yup, I have libjpeg.so.62.0 in /usr/local/lib. I tried compiling PIL with only the shared library installed, only the static jpeg library installed, or both, but the results are the same, no JPEG support. I have absolutely no ideas what to do now. ldd _imaging.so tells me it needs -ljpeg.62.0, which I assume means that it needs libjpeg.so.62.0, right? From berendsen@chem.rug.nl Mon Jan 21 20:44:59 2002 From: berendsen@chem.rug.nl (Herman Berendsen) Date: Mon, 21 Jan 2002 21:44:59 +0100 Subject: [Image-SIG] fonts Message-ID: <3C4C7DCB.9080808@chem.rug.nl> I have a probably silly question. After loading PIL (on Windows98), I cannot detect any fonts to be present, that are instances of the ImageFont class and can be used e.g. to write text in ImageDraw. I do have .bdf font files, but don't know how to convert those (with pilfont). Do I miss something trivial? 'The Python Imaging Library' by Fredrik Lundh doen't help me here. Herman Berendsen, Groningen, the Netherlands From sherwin@nlm.nih.gov Tue Jan 22 14:56:57 2002 From: sherwin@nlm.nih.gov (Ziying Sherwin) Date: Tue, 22 Jan 2002 09:56:57 -0500 (EST) Subject: [Image-SIG] Error building PIL 1.1.2 dynamic library on Solaris 2.8 with gcc 3.0 Message-ID: We tried to build Python Imaging Library(PIL 1.1.2) with Python 2.1.1 and gcc 3.0 on our Solaris 2.8 machine. Everything went on smoothly until when we tried to build dynamic library at the top level directory. We got the following error messages: gcc -shared ./_imaging.o ./decode.o ./encode.o ./map.o ./display.o ./outline.o ./path.o libImaging/libImaging.a -L/depot/lib -ljpeg -L/depot/lib -lz -o ./_imaging.so Text relocation remains referenced against symbol offset in file 0x14c libImaging/libImaging.a(Unpack.o) 0x150 libImaging/libImaging.a(Unpack.o) 0x154 libImaging/libImaging.a(Unpack.o) 0x158 libImaging/libImaging.a(Unpack.o) 0x15c libImaging/libImaging.a(Unpack.o) 0x160 libImaging/libImaging.a(Unpack.o) [...] 0x4b4 /depot/lib/libz.a(inflate.o) 0x4b8 /depot/lib/libz.a(inflate.o) 0x4bc /depot/lib/libz.a(inflate.o) 0x4c0 /depot/lib/libz.a(inflate.o) 0x4c4 /depot/lib/libz.a(inflate.o) [...] ImagingTransformAffine 0x3c38 libImaging/libImaging.a(Geometry.o) ImagingTransformAffine 0x3d68 libImaging/libImaging.a(Geometry.o) ImagingCopy 0x64 libImaging/libImaging.a(Bands.o)ImagingCopy 0xdc libImaging/libImaging.a(Blend.o)[...] .rem 0x44 libImaging/libImaging.a(Offset.o) .rem 0x64 libImaging/libImaging.a(Offset.o) .rem 0xc0 libImaging/libImaging.a(Offset.o) [...] memset 0x1948 libImaging/libImaging.a(Draw.o) memset 0x1b28 libImaging/libImaging.a(Draw.o) memset 0x2080 libImaging/libImaging.a(Draw.o) [...] 0x638 /depot/lib/libz.a(inffast.o) 0x63c /depot/lib/libz.a(inffast.o) 0x8a0 /depot/lib/libz.a(inffast.o) 0x8a4 /depot/lib/libz.a(inffast.o) ld: fatal: relocations remain against allocatable but non-writable sections collect2: ld returned 1 exit status *** Error code 1 make: Fatal error: Command failed for target `_imaging.so' The error messages ran several pages and we have no idea about what is going on. The version of the packages that we use is jpeg 6b and zlib 1.1.3. Does anyone have similiar experience and have solutions? Thanks in advance. Ziying Sherwin P.S. I am not on the mailing list, please send your response to: sherwin@nlm.nih.gov From lennart@regebro.nu Wed Jan 23 18:36:12 2002 From: lennart@regebro.nu (Lennart Regebro) Date: Wed, 23 Jan 2002 19:36:12 +0100 Subject: [Image-SIG] Out of ideas: Can't get JPEG to work with PIL. References: Message-ID: <002a01c1a43e$bf177e00$250aa8c0@torped.se> Thanks. It was a combination: 1. there was old data in the config.cache file, when I removed it it suddenly realized that when I told it to include jpeg I actually ment it. 2. Your fix: edit Makefile to include: LIBS= -L/usr/lib -lz -L/usr/local/lib -ljpeg -lm Even when actually specifying the path to these libs with configure it doesn't change the Makefile, I guess thats a bug in the configure. import _imaging import PIL.Image dir(PIL.Image.core) ['__doc__', '__file__', '__name__', 'bit_decoder', 'blend', 'convert', 'copy', 'crc32', 'effect_mandelbrot', 'effect_noise', 'eps_encoder', 'fill', 'fli_decoder', 'font', 'getcodecstatus', 'gif_decoder', 'gif_encoder', 'hex_decoder', 'hex_encoder', 'jpeg_decoder', 'jpeg_encoder', 'linear_gradient', 'msp_decoder', 'new', 'open_ppm', 'outline', 'packbits_decoder', 'path', 'pcd_decoder', 'pcx_decoder', 'pcx_encoder', 'radial_gradient', 'raw_decoder', 'raw_encoder', 'sun_rle_decoder', 'tga_rle_decoder', 'tiff_lzw_decoder', 'wedge', 'xbm_decoder', 'xbm_encoder', 'zip_decoder', 'zip_encoder'] Tadaa! The jpeg encoder and decoder are now in the list! So now it should work. Again, thanks! From joonas@olen.to Thu Jan 24 13:47:17 2002 From: joonas@olen.to (Joonas Paalasmaa) Date: Thu, 24 Jan 2002 15:47:17 +0200 Subject: [Image-SIG] Problems with opening some PNG files Message-ID: <3C501065.EB129F7A@olen.to> Python raises this exception when opening certain PNG images with PIL. Some PNG images work fine and some doesn't. I put a problematic image online at http://speedloop2000.com/problem.png Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import Image >>> im = Image.open("problem.png") >>> im.load() Traceback (most recent call last): File "", line 1, in ? File "C:\PYTHON\PIL \ImageFile.py", line 166, in load raise IOError, "decoder error %d when reading image file" % e IOError: decoder error -3 when reading image file From DBatson@efeckta.com Fri Jan 25 23:13:47 2002 From: DBatson@efeckta.com (DBatson@efeckta.com) Date: Fri, 25 Jan 2002 16:13:47 -0700 Subject: [Image-SIG] PIL help Message-ID: I've been attempting to get the PIL to read in simple PGM P2 format images. I'm now using the 'fromstring' function, with basically the same results as when I was using the Image.open() format. The file reads in without errors, but the data seems to be allocated incorrectly. A historgam run on 512X512 image might yield 11 nonZero values, but the 11 values sum to = 512^2. I have used the raw decoder, and pretty much every raw mode in the documentation. Sigh. I'm completely baffled. Can anyone suggest a course of action (other than wiskey)? Dave Batson (dbatson@efeckta.com) From bh@intevation.de Sat Jan 26 15:22:54 2002 From: bh@intevation.de (Bernhard Herzog) Date: 26 Jan 2002 16:22:54 +0100 Subject: [Image-SIG] Problems with opening some PNG files In-Reply-To: <3C501065.EB129F7A@olen.to> References: <3C501065.EB129F7A@olen.to> Message-ID: <6qsn8tf86p.fsf@abnoba.intevation.de> Joonas Paalasmaa writes: > Python raises this exception when opening certain PNG images > with PIL. Some PNG images work fine and some doesn't. I put a > problematic image online at http://speedloop2000.com/problem.png [...] > IOError: decoder error -3 when reading image file Looks like it could be the problem I ran into as well. I've posted a patch last July: http://mail.python.org/pipermail/image-sig/2001-July/001548.html Fredrik told me that it will be in the next PIL release. Bernhard -- Intevation GmbH http://intevation.de/ Sketch http://sketch.sourceforge.net/ MapIt! http://mapit.de/ From jbmoody@oakland.edu Mon Jan 28 13:52:52 2002 From: jbmoody@oakland.edu (Jon Moody) Date: Mon, 28 Jan 2002 08:52:52 -0500 Subject: [Image-SIG] patch for _rotate() bug in Image-1.1.2 Message-ID: <20020128085252.A19982@oakland.edu> --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline There is an apparent bug in _imaging.c: the _rotate() function ignores the 'filter' argument whenever the pixel type is anything other than IMAGING_TYPE_SPECIAL (e.g. IMAGING_TYPE_INT32, etc.). Patch attached. --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="Imaging-1.1.2.patch" --- Imaging-1.1.2/_imaging.c Mon Jan 28 08:37:03 2002 +++ Imaging-1.1.2-new/_imaging.c Mon Jan 28 08:43:11 2002 @@ -1199,7 +1199,7 @@ ImagingRotate180(imOut, imIn); else /* Use ordinary version */ - ImagingRotate(imOut, imIn, theta, 0); + ImagingRotate(imOut, imIn, theta, filter); } } --lrZ03NoBR/3+SXJZ-- From eaw@connactivity.connactivity.com Tue Jan 29 04:40:01 2002 From: eaw@connactivity.connactivity.com (Eric Woudenberg) Date: Mon, 28 Jan 2002 23:40:01 -0500 Subject: [Image-SIG] problem decoding JPEG files on freshly built PIL 1.1.2 on BSD unix Message-ID: <200201290440.g0T4e1x13667@connactivity.connactivity.com> Hi, I'm using PIL 1.1.2 happily under Windows to produce thumbnails from .gif and .jpeg files. The final app must run under BSDI4.0. I rebuilt PIL from sources, also built Jpeg-6b and zlib-1.1.3. Everything built and passed tests (PIL passed up to the point where the image was trying to be displayed -- I don't have a screen on this machine): mook:~/src/Imaging-1.1.2/libImaging $ make check ./coretest >>> processing lena.ppm... >>> elapsed time: 10 >>> as far as we tested, everything seems to be ok... xv test.ppm xv: Can't open display *** Error code 1 (ignored) But when I use it, I always get an error that it couldn't decode the file: mook:~/src/Imaging-1.1.2/Images $ python Python 2.2 (#5, Jan 27 2002, 22:13:28) [GCC 2.7.2.1] on bsdos4 Type "help", "copyright", "credits" or "license" for more information. >>> import Image >>> a=Image.open('lena.jpg') >>> a.getbbox() Traceback (most recent call last): File "", line 1, in ? File "/home/minidisc/local/lib/python2.2/site-packages/PIL/Image.py", line 514, in getbbox self.load() File "/home/minidisc/local/lib/python2.2/site-packages/PIL/ImageFile.py", line 166, in load raise IOError, "decoder error %d when reading image file" % e IOError: decoder error -2 when reading image file >>> Any ideas? My impression was that this should "just work", given that it all works so nicely under windows. The Jpeg decoder is being built in (from ImConfig.h): /* Define if you have the IJG jpeg library (-ljpeg). */ #define HAVE_LIBJPEG 1 GIF files seem to work okay. Thanks in advance for any help or suggestions. Eric Woudenberg From Jean-Francois.Doyon@CCRS.NRCan.gc.ca Wed Jan 30 15:38:28 2002 From: Jean-Francois.Doyon@CCRS.NRCan.gc.ca (Doyon, Jean-Francois) Date: Wed, 30 Jan 2002 10:38:28 -0500 Subject: [Image-SIG] Getting Image resolution ? Message-ID: <7CDD7B94357FD5119E800002A537C46E22FE5F@s5-ccr-r1.ccrs.nrcan.gc.ca> Hello, Is there a way to find out the resolution of a saved image? I have a bunch of GIF's/JPEG's/TIFF's and I need to know what DPI they = were scanned as ... i.e. 300dpi and so on ... I'm hoping ot use this information and their pixel size to calculate = their "real" paper size. Thank you, Jean-Fran=E7ois Doyon Internet Service Development and Systems Support GeoAccess Division Canadian Center for Remote Sensing Natural Resources Canada http://atlas.gc.ca Phone: (613) 992-4902 Fax: (613) 947-2410 From hancock@ipac.caltech.edu Wed Jan 30 15:53:29 2002 From: hancock@ipac.caltech.edu (Terry Hancock) Date: Wed, 30 Jan 2002 07:53:29 -0800 (PST) Subject: [Image-SIG] Getting Image resolution ? In-Reply-To: <7CDD7B94357FD5119E800002A537C46E22FE5F@s5-ccr-r1.ccrs.nrcan.gc.ca> Message-ID: I'm pretty sure that TIFFs contain this information, but I think that JPEGs and GIFs do not. For those, you will probably have to get this information some other way (such as asking the user). I'm hoping someone else will tell you how to extract it from the TIFF header, as I don't know that part. Terry ------------------------------------------------------ * Terry Hancock -- Science Software Support -- IPAC * * http://www.ipac.caltech.edu/local/Science/sw/ * * hancock@ipac.caltech.edu * ------------------------------------------------------ On Wed, 30 Jan 2002, Doyon, Jean-Francois wrote: > Is there a way to find out the resolution of a saved image? > I have a bunch of GIF's/JPEG's/TIFF's and I need to know what DPI they were > scanned as ... i.e. 300dpi and so on ... From hancock@ipac.caltech.edu Thu Jan 31 20:54:16 2002 From: hancock@ipac.caltech.edu (Terry Hancock) Date: Thu, 31 Jan 2002 12:54:16 -0800 (PST) Subject: [Image-SIG] jpeglib.h (from jpeg-6b library) In-Reply-To: <200201290440.g0T4e1x13667@connactivity.connactivity.com> Message-ID: In building PIL 1.1.2's libImaging module, I run into a problem with compiling JpegDecode.c, which uses Jpeg.h, which in turn is trying to find jpeglib.h (from the jpeg-6b library). What's weird is that it is looking for "jpeglib.h" (i.e. in the current build directory), not (on the INCLUDE path). Is it expected that I would copy all of the built jpeg-6b files into the libImaging directory before building it? That seems a little unusual, though I don't suppose there's any reason I can't. But it doesn't seem like the usual procedure, so I thought maybe I'm missing a step, or it's a bug. But I hesitate to edit the header file until I know what was originally intended. :) As you will probably guess, I installed the jpeg library into the lib and include directories which I'm using for other software besides PIL, which seems to be the usual practice for library packages. It's not under /usr/local, but under a custom directory tree on my system, if that matters (i.e. I used the --prefix option on configure). Thanks! Terry ------------------------------------------------------ * Terry Hancock -- Science Software Support -- IPAC * * http://www.ipac.caltech.edu/local/Science/sw/ * * hancock@ipac.caltech.edu * ------------------------------------------------------