By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,244 Members | 1,772 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,244 IT Pros & Developers. It's quick & easy.

PIL for Python 2.4?

P: n/a
Has anyone built PIL (1.1.4 or 1.1.5) for Python 2.4? If yes, please
let me know, since I can't test a couple of my apps using PIL with 2.4 .
You can even reply by email (yes, I dare use true email in newsgroup
postings, but then, I'm postmaster and welcome spam :)

TIA
--
TZOTZIOY, I speak England very best,
"Tssss!" --Brad Pitt as Achilles in unprecedented Ancient Greek
Jul 18 '05 #1
Share this Question
Share on Google+
15 Replies


P: n/a
On Thu, Nov 18, 2004 at 02:57:01PM +0200, Christos TZOTZIOY Georgiou wrote:
Has anyone built PIL (1.1.4 or 1.1.5) for Python 2.4? If yes,
please let me know, [...]


I haven't. But it would have been useful if you had mentioned which
platform ;-) Windows?

-- Gerhard
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBnKD+dIO4ozGCH14RAqHJAKCMMKVyDtjJBA3aTLZ0mh od9fi+UACgokj/
fybjWX1OZaM4cGIM1Sp3zac=
=VBc9
-----END PGP SIGNATURE-----

Jul 18 '05 #2

P: n/a
On Thu, 18 Nov 2004 14:17:50 +0100, rumours say that Gerhard Haering
<gh@ghaering.de> might have written:
Has anyone built PIL (1.1.4 or 1.1.5) for Python 2.4? If yes,
please let me know, [...]


I haven't. But it would have been useful if you had mentioned which
platform ;-) Windows?


Oh, yes, Windows... On Linux I built it myself. I just don't have
access to a MS compiler on Windows.

Sorry for not being clear.
--
TZOTZIOY, I speak England very best,
"Tssss!" --Brad Pitt as Achilles in unprecedented Ancient Greek
Jul 18 '05 #3

P: n/a
Christos TZOTZIOY Georgiou wrote:
On Thu, 18 Nov 2004 14:17:50 +0100, rumours say that Gerhard Haering
<gh@ghaering.de> might have written:

Has anyone built PIL (1.1.4 or 1.1.5) for Python 2.4? If yes,
please let me know, [...]


I haven't. But it would have been useful if you had mentioned which
platform ;-) Windows?

Oh, yes, Windows... On Linux I built it myself. I just don't have
access to a MS compiler on Windows.

Sorry for not being clear.

well I have old MS VC++ 6 and building with setup.py Python 2.4b2 gives an error
related to the compiler; :( I guess I need MSVC++ 7.

I have MSDN subscription, but no idea whether I can get 6 & 7 to coexist.

#####
running build_ext
Traceback (most recent call last):
File "setup.py", line 314, in ?
ext_modules = MODULES,
File "C:\python24\lib\distutils\core.py", line 149, in setup
dist.run_commands()
File "C:\python24\lib\distutils\dist.py", line 946, in run_commands
self.run_command(cmd)
File "C:\python24\lib\distutils\dist.py", line 966, in run_command
cmd_obj.run()
File "C:\python24\lib\distutils\command\install.py" , line 501, in run
self.run_command('build')
File "C:\python24\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "C:\python24\lib\distutils\dist.py", line 966, in run_command
cmd_obj.run()
File "C:\python24\lib\distutils\command\build.py", line 112, in run
self.run_command(cmd_name)
File "C:\python24\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "C:\python24\lib\distutils\dist.py", line 966, in run_command
cmd_obj.run()
File "C:\python24\lib\distutils\command\build_ext.p y", line 253, in run
force=self.force)
File "C:\python24\lib\distutils\ccompiler.py", line 1177, in new_compiler
return klass (None, dry_run, force)
File "C:\python24\lib\distutils\msvccompiler.py", line 206, in __init__
self.__macros = MacroExpander(self.__version)
File "C:\python24\lib\distutils\msvccompiler.py", line 112, in __init__
self.load_macros(version)
File "C:\python24\lib\distutils\msvccompiler.py", line 128, in load_macros
self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv1.1")
File "C:\python24\lib\distutils\msvccompiler.py", line 118, in set_macro
self.macros["$(%s)" % macro] = d[key]
KeyError: 'sdkinstallrootv1.1'

--
Robin Becker
Jul 18 '05 #4

P: n/a
On Thu, 18 Nov 2004 15:03:46 +0000, rumours say that Robin Becker
<ro***@reportlab.com> might have written:
well I have old MS VC++ 6 and building with setup.py Python 2.4b2 gives an error
related to the compiler; :( I guess I need MSVC++ 7.


I didn't even *try* to build it on an installation of MS VS 6 we have in
the office because I remember the long discussion about the transition
to VS 7, and the need for the building of other libriaries with VS 7
too... Of course, I could completely build Python 2.4 with VS 6 and
then build PIL, which is what I'll do next. I just wanted to avoid
troubles with VS 6 project files being out of sync, so I asked if anyone
did the build.

Thanks for trying though.
--
TZOTZIOY, I speak England very best,
"Tssss!" --Brad Pitt as Achilles in unprecedented Ancient Greek
Jul 18 '05 #5

P: n/a
Christos TZOTZIOY Georgiou wrote:
On Thu, 18 Nov 2004 15:03:46 +0000, rumours say that Robin Becker
<ro***@reportlab.com> might have written:

well I have old MS VC++ 6 and building with setup.py Python 2.4b2 gives an error
related to the compiler; :( I guess I need MSVC++ 7.

I didn't even *try* to build it on an installation of MS VS 6 we have in
the office because I remember the long discussion about the transition
to VS 7, and the need for the building of other libriaries with VS 7
too... Of course, I could completely build Python 2.4 with VS 6 and
then build PIL, which is what I'll do next. I just wanted to avoid
troubles with VS 6 project files being out of sync, so I asked if anyone
did the build.

Thanks for trying though.


I had a few problems building 2.4b2 on 6; I think the old projects are unmaintained.
--
Robin Becker
Jul 18 '05 #6

P: n/a
Robin Becker <ro***@reportlab.com> writes:
Christos TZOTZIOY Georgiou wrote:
On Thu, 18 Nov 2004 14:17:50 +0100, rumours say that Gerhard Haering
<gh@ghaering.de> might have written:
Has anyone built PIL (1.1.4 or 1.1.5) for Python 2.4? If yes,
please let me know, [...]

I haven't. But it would have been useful if you had mentioned which
platform ;-) Windows?

Oh, yes, Windows... On Linux I built it myself. I just don't have
access to a MS compiler on Windows.
Sorry for not being clear.

well I have old MS VC++ 6 and building with setup.py Python 2.4b2
gives an error related to the compiler; :( I guess I need MSVC++ 7.

I have MSDN subscription, but no idea whether I can get 6 & 7 to coexist.


You need 7.1, not 7.0. Aka named Visual Studio .NET 2003.

And it coexists with 6.0.

Thomas
Jul 18 '05 #7

P: n/a
Thomas Heller wrote:
Robin Becker <ro***@reportlab.com> writes:

Christos TZOTZIOY Georgiou wrote:
On Thu, 18 Nov 2004 14:17:50 +0100, rumours say that Gerhard Haering
<gh@ghaering.de> might have written:
>Has anyone built PIL (1.1.4 or 1.1.5) for Python 2.4? If yes,
>please let me know, [...]

I haven't. But it would have been useful if you had mentioned which
platform ;-) Windows?

Oh, yes, Windows... On Linux I built it myself. I just don't have
access to a MS compiler on Windows.
Sorry for not being clear.


well I have old MS VC++ 6 and building with setup.py Python 2.4b2
gives an error related to the compiler; :( I guess I need MSVC++ 7.

I have MSDN subscription, but no idea whether I can get 6 & 7 to coexist.

You need 7.1, not 7.0. Aka named Visual Studio .NET 2003.

And it coexists with 6.0.

Thomas

Thanks Thomas, I'll have a go at installing it soon.
--
Robin Becker
Jul 18 '05 #8

P: n/a
Christos TZOTZIOY Georgiou wrote:
On Thu, 18 Nov 2004 14:17:50 +0100, rumours say that Gerhard Haering
<gh@ghaering.de> might have written:

Has anyone built PIL (1.1.4 or 1.1.5) for Python 2.4? If yes,
please let me know, [...]


I haven't. But it would have been useful if you had mentioned which
platform ;-) Windows?

Oh, yes, Windows... On Linux I built it myself. I just don't have
access to a MS compiler on Windows.

Sorry for not being clear.

You can download Microsoft's C/C++ compiler for free. (It's command
line only, but good enough.)

http://msdn.microsoft.com/visualc/vctoolkit2003/
Chris
Jul 18 '05 #9

P: n/a
On Thu, 18 Nov 2004 11:21:09 -0500, rumours say that Christopher
Boumenot <bo*************@hotmail.com> might have written:
You can download Microsoft's C/C++ compiler for free. (It's command
line only, but good enough.)

http://msdn.microsoft.com/visualc/vctoolkit2003/


<hitting my head on the keyb hguhynbuyh7nbuyh7j6nb>

Thank you! Thank you! Thank you! Now that you told me I remembered
I'd read about it and completely forgot... ...and thank you!
--
TZOTZIOY, I speak England very best,
"Tssss!" --Brad Pitt as Achilles in unprecedented Ancient Greek
Jul 18 '05 #10

P: n/a
Christos TZOTZIOY Georgiou wrote:
Has anyone built PIL (1.1.4 or 1.1.5) for Python 2.4? If yes, please
let me know, since I can't test a couple of my apps using PIL with 2.4 .
You can even reply by email (yes, I dare use true email in newsgroup
postings, but then, I'm postmaster and welcome spam :)

TIA

[... windows ... replies from others on using the MS VC 7.1 ...]
Note that if you install MinGW, distutils can build acceptable
files with it. Since I believe I remember the PIL stuff is set up
to build with distutils, you should be able to get it going that way
as well.

--Scott David Daniels
Sc***********@Acm.Org
Jul 18 '05 #11

P: n/a
Scott David Daniels wrote:
Christos TZOTZIOY Georgiou wrote:
Has anyone built PIL (1.1.4 or 1.1.5) for Python 2.4? If yes, please
let me know, since I can't test a couple of my apps using PIL with 2.4 .
You can even reply by email (yes, I dare use true email in newsgroup
postings, but then, I'm postmaster and welcome spam :)

TIA


[... windows ... replies from others on using the MS VC 7.1 ...]
Note that if you install MinGW, distutils can build acceptable
files with it. Since I believe I remember the PIL stuff is set up
to build with distutils, you should be able to get it going that way
as well.

I tried building PIL with mingw recently and had some failures I can't
remember ...

It *did* make me think "I wish there was some Pure Python image-handling
code". It seems like the C linkage is mainly required for image
formatting handling - I couldn't find any JPEG reading/writing code in
Pure Python ... would be nice :-)

David
Jul 18 '05 #12

P: n/a
David Fraser wrote:
I tried building PIL with mingw recently and had some failures I can't remember ...
if you don't report your build problems, they will never get fixed (the
image-sig is the right forum for this, and the best place to get answers
to PIL-related questions).
It *did* make me think "I wish there was some Pure Python image-handling code". It seems like the
C linkage is mainly required for image formatting handling - I couldn't find any JPEG
reading/writing code in Pure Python ... would be nice :-)


and incredibly slow. PIL uses C for a reason.

</F>

Jul 18 '05 #13

P: n/a
Fredrik Lundh wrote:
David Fraser wrote:

I tried building PIL with mingw recently and had some failures I can't remember ...


if you don't report your build problems, they will never get fixed (the
image-sig is the right forum for this, and the best place to get answers
to PIL-related questions).


Thanks, I'll try reproduce and mail it there...
<sigh> I'm on too many mailing lists already ...
It *did* make me think "I wish there was some Pure Python image-handling code". It seems like the
C linkage is mainly required for image formatting handling - I couldn't find any JPEG
reading/writing code in Pure Python ... would be nice :-)


and incredibly slow. PIL uses C for a reason.


I've recently discovered you can use the EXIF module to read thumbnails
that are embedded in a JPEG or TIFF file without having to parse all the
JPEG stuff. All I'm doing for my particular task is creating thumbnails
- I can imagine that this may be reasonably fast within Python.
Even if it was slow, it wouldn't neccessarily have to be *incredibly*
slow :-)

David

Jul 18 '05 #14

P: n/a
David Fraser wrote:
Fredrik Lundh wrote:
David Fraser wrote:
It *did* make me think "I wish there was some Pure Python
image-handling code". It seems like the C linkage is mainly required
for image formatting handling - I couldn't find any JPEG
reading/writing code in Pure Python ... would be nice :-)

and incredibly slow. PIL uses C for a reason.


I've recently discovered you can use the EXIF module to read thumbnails
that are embedded in a JPEG or TIFF file without having to parse all the
JPEG stuff. All I'm doing for my particular task is creating thumbnails
- I can imagine that this may be reasonably fast within Python.
Even if it was slow, it wouldn't neccessarily have to be *incredibly*
slow :-)


I couldn't resist it... I found a C++ simple (and imperfect) JPEG parser
(http://www.codeproject.com/bitmap/TonyJpegLib.asp) and converted it by
hand to pure Python ...
It can basically decode most JPEG files and then output the result as a BMP.
Not surprisingly, it's fairly slow. Using Psyco can speed it up.
Here's a table of a brief test, image size and execution time under
Standard Python and Psyco running on my Athlon
Image Size | Standard Python | Psyco
photo, 2048 x 1536 | 32 minutes | 46 seconds
cartoon, 604 x 446 | 16 seconds | 4 seconds

I would guess that the algorithms being designed for C is a major
factor, and that doing some simple recoding would speed it up a fair bit.

I've put the code at http://davidf.sjsoft.com/files/pyjpeg/
I wrote a basic BMP format handler as well that the test handler
requires so that's there too.

Note 1: I am only beginning to understand JPEG from converting the code
:-) And the original C++ code doesn't convert the image perfectly, it
has plenty of smudges which my Python code faithfully reproduces

Note 2: The code is horribly ugly for Python code

Anyone welcome to clean and speed it up...

David
Jul 18 '05 #15

P: n/a
David Fraser:
Image Size | Standard Python | Psyco
photo, 2048 x 1536 | 32 minutes | 46 seconds
cartoon, 604 x 446 | 16 seconds | 4 seconds


It's a cute toy; Tkinter can be used to (slowly) show the jpeg image.
(I think there is a bug for images with sides not divisible by 8.)

Bearophile
Jul 18 '05 #16

This discussion thread is closed

Replies have been disabled for this discussion.