JPG Image Load,Resize,Save with 100% Python?

Gilles Lenfant glenfant-nospam at bigfoot.com
Mon Feb 9 09:40:18 CET 2004


"Ingo Linkweiler" <i.linkweiler at web.de> a écrit dans le message de
news:c05dj3$q37$04$1 at news.t-online.com...
> Hello,
>
> I am looking for a 100% python lib/script which can load a jpg image,
> detect its size, resize and save it as new file.
>
> I have found some tools (like PIL), but all of them use ImageMagic or
> external dlls, which can not be used on my web server.
>
> I hope you can help me.
>
> Ingo
>

Have a look at how Zope detects JPGs and gets their size, in the
.../lib/python/OFS/File.py (Image class) in a 100% core Python way.
Unfortunately resizing a JPEG in pure python is something that nobody does
because resizing a bitmap image (in whatever format) in pure Python would be
very slow.

HTH

--
Gilles





More information about the Python-list mailing list