A use for integer quotients

Fredrik Lundh fredrik at pythonware.com
Mon Jul 23 05:26:46 EDT 2001


David wrote:
> 6 instances of determining transformed image sizes:
> newX = (oldX * targetSize)/max(oldX,oldY) etc.  I don't know whether PIL
> allows image.resize() to take float arguments, whether it throws an
> exception, or whether it just does something bogus.

PIL picks the largest possible image size not larger
than the given size.

> Not even counting the divisions I'm sure are lurking in PIL?

PIL will break.

> So, anyone who I might have passed the program on to will one
> day suddenly see ugly floats in their generated web pages, if the
> program still works at all, and won't have any clue why or how to
> fix it.

welcome to the wonderful world of Python 3000.

</F>





More information about the Python-list mailing list