loading table of contents...

8.2.2. Image Cropping in CAE

As described in the [CoreMedia Studio Developer Manual] in chapter Enabling Image Cropping, there are predefined crops, which can be applied to image rendering in the CAE. CoreMedia Blueprint comes with nine predefined cropping definitions as shown in the PerfectChef and Aurora sites.

  • portrait_ratio20x31
  • portrait_ratio3x4
  • portrait_ratio1x1
  • landscape_ratio4x3
  • landscape_ratio16x9
  • landscape_ratio2x1
  • landscape_ratio5x2
  • landscape_ratio8x3
  • landscape_ratio4x1

The necessary settings for the image will be set by Studio once you open the image in Studio. To render images correctly even if they were not imported through Studio but for example by the Importer or WebDAV, the CAE provides a default cropping configuration for those images, which don't have the settings explicitly set. You will find these default settings in

/modules/shared/image-transformation/src/main/resources/framework/spring/mediatransform.xml

In this file, there is a list of the transformations mentioned above. Please refer to the Javadoc of com.coremedia.cap.transform.Transformation for all configuration possibilities. New Spring bean definitions of this class will be automatically injected to the TransformImageService that is responsible for all variant definitions.

Site Specific Image Variants
[Warning]Warning
The features requires template changes. Examples for this are currently not supported by the CoreMedia Blueprint.

For the CAE, the class TransformImageService is responsible for loading site specific cropping information. The feature can be enabled by changing/adding the Spring property imageTransformation.dynamicVariants to true.

The TransformImageService requires a lookup of the Struct that contains the information about the image variants. Therefore, it must be injected with an instance of VariantsStructResolver which resolves the global and site specific image variants. The implementation of this interface is part of the shared module image-transformation, since the lookup is content type specific and therefore can not be part of the core.