473,324 Members | 2,313 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

PIL for Python 2.4?

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
15 2158
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.