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

Espen Moe-Nilssen 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/
>
> iEYEARECAAYFAkl5kNMACgkQCJIWIbr9KYxRCACeKRywyArTKkABQxz4g8e/BckD
> XaoAoNwFqdgLp/QAO3kKG1UvNVtC2lcf
> =DsFt
> -----END PGP SIGNATURE----- 
> <lists.vcf>_______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> http://lists.plone.org/mailman/listinfo/product-developers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20090123/f2c30b18/attachment.html>


More information about the Product-Developers mailing list