[Product-Developers] Re: [AT/ImageField] Rescaling images with a fixed width

Raphael Ritz r.ritz at biologie.hu-berlin.de
Fri Jan 23 15:17:23 UTC 2009


Andreas Jung wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Thanks for the pointers but I decided to implement the resizing
> code on top of PIL.Image.resize() with at_post_edit_script() instead of
> depending on some internal ImageField madness :->

Which would just trigger PIL.Image.resize anyways ;-)

Raphael

> 
> Andreas
> 
> On 23.01.2009 10:41 Uhr, Andreas Jung wrote:
>> 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'
> 
> 
> 
> - ------------------------------------------------------------------------
> 
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> http://lists.plone.org/mailman/listinfo/product-developers
> 
> 
> - -- 
> ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
> Web: www.zopyx.com - Email: info at zopyx.com - Phone +49 - 7071 - 793376
> Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535
> Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK
> - ------------------------------------------------------------------------
> E-Publishing, Python, Zope & Plone development, Consulting
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAkl5pxEACgkQCJIWIbr9KYyF8ACfaVlT4mNv4AT3BJGcsqQw+I/f
> tLcAoN/QaFs0a0TuLWk0Igih1ZwFtDqs
> =Gyu0
> -----END PGP SIGNATURE-----
> 
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> http://lists.plone.org/mailman/listinfo/product-developers





More information about the Product-Developers mailing list