Hey, so I've got this code to quickly create thumbnail files, below.
When I give it a value, it squishes the image to those dimensions, I'm
hoping to keep the correct proportions of a book instead of cropping
to a square or squashing.

Mainly as books can be portrait, landscape or square. So keep the
correct proportions, and make the tallest edge '120px'.

Know what I mean??


def gen_thumb(source, dest, size=120):
        image = Image.open(source)
        w,h = image.size

        tn = image.resize((size,size), Image.ANTIALIAS)
        tn.save(dest)
        return dest
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to