close

Filter

loading table of contents...

Blueprint Developer Manual / Version 2304

Table Of Contents

6.2.2 Image Cropping in CAE

As described in Section 9.5.3, “Image Cropping and Image Transformation” in Studio Developer Manual, there are predefined crops, which can be applied to image rendering in the CAE. CoreMedia Blueprint comes with four predefined cropping definitions.

  • portrait_ratio3x4
  • portrait_ratio1x1
  • landscape_ratio4x3
  • landscape_ratio16x9

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, 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

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.dynamic-variants 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.

For example the Corporate site comes with additional predefined cropping definitions.

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

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.