This package provides image cropping for images which reside in ATContentTypes fields in Plone. Those images can be cropped without losing the original images and without adding new images to blobs. It only sets the cropping dimension to the object annotations.
Currently tested With
- Plone-4.3.3 and Python-2.7.x
- Image and News Item Content Types.
How to crop image
- Activate collective.cropimage package through Add-ons configuration page.
- Click link Crop Image Registry under Add-on Configuration.
- Add ID with which the crop dimension will be stored.
- Go to content type where you want to crop images.
- From Actions, click Crop Image.
- Select the name of ID.
- Now you can drag over image to select the crop area.
- Save the area.
How to use the cropped image on your template
<div tal:replace="structure python: context.restrictedTraverse('cropped-image')('image', 'small-image')" />
Here, image is the field name and small-image is the ID name.
collective.cropimage works with collective.contentleadimage, too. The image field name is leadImage, so use cropped image like:
<div tal:replace="structure python: context.restrictedTraverse('cropped-image')('leadImage', 'small-image')" />