A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/335409.html below:

Predicting Thumbnail Sizes from PIL

Predicting Thumbnail Sizes from PIL Predicting Thumbnail Sizes from PILRoger crosseyedpenguin at cox.net
Sun Sep 11 09:05:09 EDT 2005
I need to calculate the thumbnail sizes PILL will produce from an image. 
  In most cases I can divide and round by adding .5, but PIL seems to 
round differently on odd sized images.

For example, I want to reduce an 800x816 image to have a maximum size of 
697.  (697/816) * 800 = 683.33, so my rounding results in 683.  But PIL 
produces an image of 684x697.

Is there an easy rule that will always work -- like adding .67 instead 
of .5?

Roger

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4