Sizing Up Graphics Automatically

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


Hi,

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.

see http://www.pythonware.com/products/pil/index.htm

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.

hth
Werner

"Ben Ocean" <zope at thewebsons.com> wrote in message
news:mailman.1005924983.29807.python-list at python.org...
> 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
of
> 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