[Product-Developers] [AT/ImageField] Rescaling images with a fixed width
espen at medialog.no
Fri Jan 23 09:54:38 UTC 2009
Adding a new PIL size might help you doing this.
Lets say you add another size, 200px wide and 800px height, then this
size would always scale to 200px wide.
I have only done this by adding the size to PIL/plone itself, which
is probably not the perfect approach...
(=there is a file that holds the PIL sizes, and you can add another
size to this)
Den 23. jan. 2009 kl. 10.41 skrev Andreas Jung:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> Hi there,
> I have the following usecase:
> - an ATImage derived image class contains a field "imageClass"
> - for a certain value of 'imageClass' the uploaded original image
> must be scaled up or down to _fixed width of 500px_ (independent
> of the image ratio) for all cases.
> I came to the point where I am able to set the 'max_size' and
> 'original_size' parameter for individual instances of my image class
> implementation. Scaling an image down to 500px width works so far
> for image where width>height but not if height>width. Also upscaling
> does not seem to be support by rescaleOriginal() implementation
> of ImageField. Any hint if this problem can be solved with a custom
> parameters for 'max_size' and/or 'original_size'
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> -----END PGP SIGNATURE-----
> Product-Developers mailing list
> Product-Developers at lists.plone.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Product-Developers