PIL JPEG Windows Problem

Steve Holden steve at holdenweb.com
Sat Oct 30 02:55:19 EDT 2004


Ann wrote:

> "Steve Holden" <steve at holdenweb.com> wrote in message
> news:6U5gd.19857$SW3.18915 at fed1read01...
> 
>>If nobody has a quick answer I'll go to the PIL list, but I'm having
>>problems with PIL JPEG support on Windows, and figured someone on c.l.py
>>might have solved this problem.
>>
>>I built the Cygwin PIL from source, and that works a treat.
>>Unfortunately the Windows version (1.1.4 and 1.1.5b1) loaded using
>>binary installers is giving
> 
<unsnip :-)>

   File "/c/steve/website/hpgraphics.py", line 23, in ?
   File "C:\Python23\Lib\site-packages\PIL\ImageFont.py", line 115, in ?
     class FreeTypeFont:
   File "C:\Python23\Lib\site-packages\PIL\ImageFont.py", line 132, in 
FreeTypeFont
     def getmask(self, text, mode="", fill=Image.core.fill):
   File "C:\Python23\Lib\site-packages\PIL\Image.py", line 45, in 
__getattr__
     raise ImportError("The _imaging C module is not installed")
ImportError: The _imaging C module is not installed

> 
> I am a newbie, but I installed python about 2 months ago, from binaries
> and added PIL maybe a month ago with no problems on Win XP Pro. I refuse
> to compile anything.
> The python log file has no 'jpg' or 'jpeg' files, but the
> PIL log file has these two:
> 200 File Copy: C:\Python23\Lib\site-packages\PIL\JpegImagePlugin.py
> 200 File Copy: C:\Python23\Lib\site-packages\PIL\JpegImagePlugin.pyc
> I do not have libjpeg.dll
> HTH
> 
> 
>>When I import the _imaging module directly a dialog box informs me that
>>libjpeg.dll can't be found, and I have confirmed that it isn't anywhere
>>on the disk  - I have a libjpeg.dll.a as part of cygwin, but I can't
>>persuade myself this can be munged into suitable form. It would be nice
>>if I were wrong ...
>>
>>The PIL docs do say something about having to add JPEG support, but
>>unfortunately I can't find any information about adding *Windows* JPEG
>>support.
>>

Thanks for the input, but it doesn't, unfortunately, help - I have those 
files too. I presume you are using PIL 1.1.4?

I thought it might be a 1.1.5b1-specific thing, but sadly a de-install 
followed by a re-install of 1.1.4 gives me the same error - a dialog box 
appears telling me that libjpeg.dll can't be found in any of an umber of 
directories (not surprising, since there is no such file on my disk).

I thought I'd fixed the problem by copying jpeg62.dll from GTK 2.0 and 
renaming it as libjpeg.dll, but unfortunately Windows then started 
complaining about the absence of libz.dll (and a copy of libz.pyd 
definitely won;t do the trick).

So I'll copy this to the PIL support list and see what the gurus have to 
say. I'm wondering if there could possibly be any interaction between 
the Cygwin and Windows versions, since both are now loaded on the same 
machine. Bit stumped here ... I don't remember PIL being so 
temperamental before, and it's working beautifully under Cygwin.

regards
  Steve
-- 
http://www.holdenweb.com
http://pydish.holdenweb.com
Holden Web LLC +1 800 494 3119



More information about the Python-list mailing list