Image Magik

Fredrik Lundh fredrik at effbot.org
Mon Nov 13 19:07:01 CET 2000


"Poparosa" wrote:
> Good thought.  Could you please tell us how to
> do this in the code?
>
> import os
> print "my installed packages are:" , os.tell_me_what_is_installed()

try:
    import Image
except:
    Image = None # no PIL

...

if Image:
    im = Image.open(file)
    im.thumbnail((200, 200))
    im.save(file + ".thumbnail", "JPEG")
else:
    ...

</F>





More information about the Python-list mailing list