info.magnolia.imaging.operations.cropresize
Class SelectedCropAndResize
java.lang.Object
info.magnolia.imaging.operations.cropresize.AbstractCropAndResize<ParameterProvider<info.magnolia.cms.core.Content>>
info.magnolia.imaging.operations.cropresize.SelectedCropAndResize
- All Implemented Interfaces:
- ImageOperation<ParameterProvider<info.magnolia.cms.core.Content>>
public class SelectedCropAndResize
- extends AbstractCropAndResize<ParameterProvider<info.magnolia.cms.core.Content>>
A CropAndResize implementation which uses coordinates as selected in a UI componenent. This currently
expects a JSon string representation of CroppingInfo (wrapped in map, which is something that might change...)
Given the goo that's Magnolia's current "hiding" of binary nodes, disguising them as properties,
it is not possible (?) for a dialog to be configured to store more properties *inside* an image's
node; so we resort to 'cropInfoSiblingPropertySuffix': we will look for a property that has the
same nade as the ParameterProvider's node, suffixed, and which is a *sibling* of the image's node,
not a children.
- Version:
- $Id$
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SelectedCropAndResize
public SelectedCropAndResize()
getCroopCoords
protected Coords getCroopCoords(BufferedImage source,
ParameterProvider<info.magnolia.cms.core.Content> params)
throws ImagingException
- Description copied from class:
AbstractCropAndResize
- Determines the coordinates of the cropping to apply on the source image.
If no cropping needs to happen, return new Coords(0, 0, source.getWidth(), source.getHeight()).
- Specified by:
getCroopCoords
in class AbstractCropAndResize<ParameterProvider<info.magnolia.cms.core.Content>>
- Throws:
ImagingException
getEffectiveTargetSize
protected Size getEffectiveTargetSize(BufferedImage source,
Coords cropCoords,
ParameterProvider<info.magnolia.cms.core.Content> params)
- Description copied from class:
AbstractCropAndResize
- Determines the actual size for the resized image based on the source image, the crop coordinates
calculated by
AbstractCropAndResize.getCroopCoords(java.awt.image.BufferedImage, P)
and the given ParameterProvider.
- Specified by:
getEffectiveTargetSize
in class AbstractCropAndResize<ParameterProvider<info.magnolia.cms.core.Content>>
setCropInfoSiblingPropertySuffix
public void setCropInfoSiblingPropertySuffix(String cropInfoSiblingPropertySuffix)
setTargetWidth
public void setTargetWidth(int targetWidth)
setTargetHeight
public void setTargetHeight(int targetHeight)
decode
protected CroppingInfo decode(String jsonString)
Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.