ImageField that crops images that do not fit the expected ratio
Project description
This will resize all images to the dimensions you specify, but instead of stretching, it will scale the images and crop the overhang.
For some examples how to configure CroppingImageField and result pictures see docs/examples.txt
To use the field:
from croppingimage.field import CroppingImageField CroppingImageField( name = 'image', long_edge_size = 600, short_edge_size = 450, # use this if you don't want portrait images to scale to (450x600) (see docs/examples.txt) force_format = 'landscape', sizes= {'large' : (600, 450), 'medium' : (300, 225), 'thumb' : (125, 94),}, widget = ImageWidget(label= "Image",)
This will create an attribute called “image” with the sizes thumb, medium, large as given.
This will be accessible as object/image, and the sizes as:
object/image_thumb
object/image_medium
object/image_large
History for Products.croppingimage
2008-07-23 0.2-rc1
added property force_format that allows to force landscape or portrait pictures. see docs/examples.txt for more information. [fRiSi]
more compact code example in README.txt [fRiSi]
2008-07-22 0.1
eggified product [fRiSi]
removed commented out “pdb set_trace” since archetypes svn repos has a commit hook that blocks checkins containing it [fRiSi]
initial import of 0.1 release to archetypes.MoreFieldsAndWidgets [fRiSi]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for Products.croppingimage-0.2rc1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0004e7b0227e5cbbdd6f0f3a8de12fc75518b86ce14cf8a2a004160af3c1c1ab |
|
MD5 | 04fe8d223a1a5521c8fc28ccb4fd4f54 |
|
BLAKE2b-256 | a77af3461dc68ef4b6080673aa3f56bba51fc014d1a4859028d79106715795eb |
Hashes for Products.croppingimage-0.2rc1-py2.4.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 565f5e3d47a42bc84c43b30af77110e875ea1ee2200494a1cb875df3fbd1b2f5 |
|
MD5 | b7036c8acddf3218b4cdcd0fc2d0b58d |
|
BLAKE2b-256 | afa80d1158d1f1341c1634d0425a81d7c5127a1b663d2d0a2d453da67202f9e8 |