Sizing Up Graphics Automatically

Werner Schiendl ws-news at
Fri Nov 16 18:46:13 CET 2001


If you just want to know the size of the Image, this information is already
available in Zope.
(otherwise it could not produce a proper IMG tag with sizes set, as it
actually does)
See the documentation of the Image object for details.

For more advanced graphics manipulations, I think PIL (Python Imaging
Library) is the tool of choice.


Resizing and querying size is probably at the simple end of the
possibilities this library provides.
You'll need External Methods or a product to use it, IIRC.


"Ben Ocean" <zope at> wrote in message
news:mailman.1005924983.29807.python-list at
> Hi;
> Is it possible to automatically size up a graphic upon upload and
> programmatic insertion into a script? I use Zope and want to build a
> through-the-Web interface to enable my client to automatically change/add
> photos, but I want to set the site up such that all the dimensions of
> graphics, font sizes, etc., are resized depending on the visitor's browser
> resolution. In order to do that, I *must* somehow capture the dimensions
> the uploaded graphic programmatically? Any ideas how to do this? Anybody
> have some code they'd like to share?
> TIA,
> BenO

More information about the Python-list mailing list