473,545 Members | 1,638 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PIL JPEG Windows Problem

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

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

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.

regards
Steve
--
http://www.holdenweb.com
http://pydish.holdenweb.com
Holden Web LLC +1 800 494 3119
Jul 18 '05 #1
3 3886
On Thu, 28 Oct 2004 08:42:42 -0400, Steve Holden <st***@holdenwe b.com> wrote:
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.
Unfortunatel y the Windows version (1.1.4 and 1.1.5b1) loaded using
binary installers is giving

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

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
unfortunatel y I can't find any information about adding *Windows* JPEG
support.

I succeeded in building PIL from source on windows about two years ago.

I had to get jpeg and zlib (setup warns about security problem if it sees old zlib )
from the net and build them myself, and then tweak setup.py to pick them up. There's
notes in setup.py about it. E.g., from Imaging-1.1.3\setup.py :

----
# on windows, the build script expects to find both library files and
# include files in the directories below. tweak as necessary.
JPEGDIR = "../../kits/jpeg-6b"
ZLIBDIR = "../../kits/zlib-1.1.3"

# on windows, the following is used to control how and where to search
# for Tcl/Tk files. None enables automatic searching; to override, set
# this to a directory name
TCLROOT = None
----

IIRC I disabled some TCLROOT logic looking for tk.h, as I didn't have the latter on disk...

It might (or not ;-) tell you something useful if you go into <something>\Ima ging-x.x.x
and type setup.py -n install, and see what goes by with zlib and jpeg in it.
It will want to build using cl.exe I think, so that needs to be available in the environment
you do it for real in, and presumably a cl.exe compatible with how your python was built
(I haven't got MSVC++7, so I can't tell you about that).

HTH
Can probably reconstruct if you get stuck. I can't find a build script for what I did
for jpeg and zlib right now though ;-( There does seem to be a .dsw MSC++ workspace project
for the jpeg though...
Regards,
Bengt Richter
Jul 18 '05 #2
Ann

"Steve Holden" <st***@holdenwe b.com> wrote in message
news:6U5gd.1985 7$SW3.18915@fed 1read01...
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
<snip>

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\Jp egImagePlugin.p y
200 File Copy: C:\Python23\Lib \site-packages\PIL\Jp egImagePlugin.p yc
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.

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

Jul 18 '05 #3
Ann wrote:
"Steve Holden" <st***@holdenwe b.com> wrote in message
news:6U5gd.1985 7$SW3.18915@fed 1read01...
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.
Unfortunate ly 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\Li b\site-packages\PIL\Im ageFont.py", line 115, in ?
class FreeTypeFont:
File "C:\Python23\Li b\site-packages\PIL\Im ageFont.py", line 132, in
FreeTypeFont
def getmask(self, text, mode="", fill=Image.core .fill):
File "C:\Python23\Li b\site-packages\PIL\Im age.py", line 45, in
__getattr__
raise ImportError("Th e _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\Jp egImagePlugin.p y
200 File Copy: C:\Python23\Lib \site-packages\PIL\Jp egImagePlugin.p yc
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
unfortunate ly 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
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3756
by: frankenberry | last post by:
I have multi-page tiff files. I need to extract individual frames from the multi-page tiffs and save them as single-page tiffs. 95% of the time I receive multi-page tiffs containing 1 or more black and white CCITT4 compressed files (frames) inside the tiff. Every now and then I receive a mixture of black and white CCITT4 and JPEG compressed...
6
1800
by: Ron Brennan | last post by:
Good evening. An HTML problem maybe, but one that I think can be solved with JavaScript. I have a page which is supposed to display several small JPEG images using elements like: <image src="SmallImages/image1.jpeg" height="40" width="30"></image> The image files are fine - I can open them reliably by double clicking in
16
11823
by: David Lauberts | last post by:
Hi Wonder if someone has some words of wisdom. I have a access 2002 form that contains 2 graph objects that overlay each other and would like to export them as a JPEG to use in a presentation. I can do this individually for each graph but this does not help me as I need both on the same JPEG. I thought I would try an export the form that...
0
2753
by: Johann Blake | last post by:
In my need to decode a JPEG 2000 file, I discovered like many that there was no functionality for this in the .NET Framework. Instead of forking out a pile of cash to do this, I came up with the idea that costs nothing and it is inheritently built into the Framework. So here is the solution... When you use the WebRequest and WebResponse...
4
50823
by: Pushp | last post by:
Hello friends, Can any body tell me the sample code to convert a Tiff image to a Gif or Jpeg format. The Resolution of picture is a big concern keeping in mind. Hope to get the response from all of you. Regards,
3
4437
by: Peter | last post by:
I have a problem which seems to come up from time to time but I can't find anything relevant in the archives. I have used PIL v1.1.5 with no problem on Windows for some time but now wish to put it on Linux (Suse Linux v10.0). I obtained and built the JPEG libraries (jpeg-6b) without any problem. The tests for the installation work fine. I...
0
2206
by: Jack Wu | last post by:
Hi I've spent a good majority of my day trying to figure out how to have PIL 1.1.5 working on my OSX 10.3.9_PPC machine. I'm still stuck and I have not gotten anywhere. Could somebody please help me... I've scoured all the documentation, google, and mailing lists to no avail. I believe the problem may lay in a jpeglib problem with OSX...
1
2543
by: Masood | last post by:
Greetings, We are writing an application wherein we have to display jpeg images, we are thinking of using the IJG JPEG LIB written in C code. Will be greatfull if someone could guide us as to how we can invoke or use the IJG LIB through C#. Thanks in Advance MasooD
1
3238
by: Joe Cool | last post by:
I am attempting to add a function to an application I am working on to modify the JPEG Comment in a Jpeg image file. I can retrieve the JPEG Comment with no problem. The problem is modifying it. I have the contents of a Jpeg loaded into an Image object, _Image, using the Image.FromFile method. I convert the Text property of a TextBox...
0
7459
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7393
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7653
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7749
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5965
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5322
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4942
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1871
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1012
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.