PIL for Python 2.4?

  • Thread starter Christos TZOTZIOY Georgiou
  • Start date
C

Christos TZOTZIOY Georgiou

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
 
G

Gerhard Haering

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+dIO4ozGCH14RAqHJAKCMMKVyDtjJBA3aTLZ0mhod9fi+UACgokj/
fybjWX1OZaM4cGIM1Sp3zac=
=VBc9
-----END PGP SIGNATURE-----
 
C

Christos TZOTZIOY Georgiou

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.
 
R

Robin Becker

Christos said:
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.py", 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'
 
C

Christos TZOTZIOY Georgiou

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.
 
R

Robin Becker

Christos said:
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.
 
T

Thomas Heller

Robin Becker said:
Christos said:
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
 
R

Robin Becker

Thomas said:
Christos said:
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.
 
C

Christopher Boumenot

Christos said:
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
 
S

Scott David Daniels

Christos said:
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
(e-mail address removed)
 
D

David Fraser

Scott said:
Christos said:
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
 
F

Fredrik Lundh

David said:
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>
 
D

David Fraser

Fredrik said:
David Fraser wrote:



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...
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
 
D

David Fraser

David said:
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
 
B

bearophile

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,285
Latest member
CryptoTaxxSoftware

Latest Threads

Top