The "Focal Point Setter" plugin allows the user to set the focal point of images.
To be configured in {home}/appserver/conf/custom.properties
type: String, required: yes, default: -, since v1.2.0
The license for the product (provided by brix IT Solutions).
type: List of String (comma-separated), required: yes, default: -
A list of supported asset type ids.
type: List of String (comma-separated), required: false, default: - (only super admins)
A list of user groups for which the menu entry is visible.
type: Long, required: yes, default: -
The id of the information field (has to have type double) used to save the horizontal percentage of the focal point.
type: Long, required: yes, default: -
The id of the information field (has to have type double) used to save the vertical percentage of the focal point.
type: Boolean, required: no, default: false
Specifies whether an entry is added to the action menu or not.
In order to use the defined focal points in export formats, you have to edit home/appserver/spring/conversionProcessDefinitions.xml
as following:
Add two new parameters "Crop Image" and "Crop Gravity" to the conversion process "DownloadImage", by inserting this XML inside the property element "parameterList" (preferably directly below the definition for the parameter "imageHeight"):
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessDefinitionParameter">
<!-- Crop Image -->
<property name="identifier" value="cropImage"/>
<property name="label" value="Crop Image?"/>
<property name="description"
value="If set to 'yes' and Image Width and Height are both not empty, the image will be cropped to exactly the width and height specified"/>
<property name="allowedValues">
<list>
<value>yes</value>
<value>no</value>
</list>
</property>
<property name="defaultValue" value="no"/>
</bean>
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessDefinitionParameter">
<!-- Crop Gravity -->
<property name="identifier" value="cropGravity"/>
<property name="label" value="Gravity"/>
<property name="description"
value="Defines the gravity towards which images will be cropped – ignored if 'Crop Image' is set to 'false', overridden if an focal point is specified on the asset"/>
<property name="allowedValues">
<list>
<value>Center</value>
<value>East</value>
<value>NorthEast</value>
<value>North</value>
<value>NorthWest</value>
<value>SouthEast</value>
<value>South</value>
<value>SouthWest</value>
<value>West</value>
</list>
</property>
<property name="defaultValue" value="Center"/>
</bean>
Inside the bean with id="parseUserSize" replace this XML snippet...
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessStep">
<property name="conversionProcessExecutorName" value="variable-modification"/>
<property name="parameters">
<set>
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessStepParameter">
<property name="parameterName" value="TargetVariable"/>
<property name="parameterValue" value="imageMagickResizeParameter"/>
</bean>
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessStepParameter">
<property name="parameterName" value="Expression"/>
<property name="parameterValue" value="-resize '$var[imageWidthParameter]x$var[imageHeightParameter]>'"/>
</bean>
</set>
</property>
</bean>
...with this one:
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessDecision">
<property name="conversionProcessExecutorName" value="option-decision"/>
<property name="parameters">
<set>
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessStepParameter">
<property name="parameterName" value="OptionValue"/>
<property name="parameterValue" value="cropImage"/>
</bean>
</set>
</property>
<property name="branches">
<set>
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessDecisionBranch">
<property name="branchName" value="no"/>
<property name="processStepList">
<list>
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessStep">
<property name="conversionProcessExecutorName" value="variable-modification"/>
<property name="parameters">
<set>
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessStepParameter">
<property name="parameterName" value="TargetVariable"/>
<property name="parameterValue" value="imageMagickResizeParameter"/>
</bean>
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessStepParameter">
<property name="parameterName" value="Expression"/>
<property name="parameterValue" value="-resize '$var[imageWidthParameter]x$var[imageHeightParameter]>'"/>
</bean>
</set>
</property>
</bean>
</list>
</property>
</bean>
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessDecisionBranch">
<property name="branchName" value="yes"/>
<property name="processStepList">
<list>
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessStep">
<property name="conversionProcessExecutorName" value="variable-modification"/>
<property name="parameters">
<set>
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessStepParameter">
<property name="parameterName" value="TargetVariable"/>
<property name="parameterValue" value="imageMagickResizeParameter"/>
</bean>
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessStepParameter">
<property name="parameterName" value="Expression"/>
<property name="parameterValue" value="-resize '$var[imageWidthParameter]x$var[imageHeightParameter]^>' -gravity $option[cropGravity] -crop '$var[imageWidthParameter]x$var[imageHeightParameter]$translator[FocalPointTranslator:$option[cropGravity]]'"/>
</bean>
</set>
</property>
</bean>
</list>
</property>
</bean>
</set>
</property>
</bean>
Attention: After adding a parameter to a conversion process, all export formats using this process might be disabled and have to be re-enabled in the CMA.
Focal Point Setter | CELUM (min. version) |
---|---|
1.0 | 5.13.3 |
1.3.7 | 5.13.4 (tested up to 6.8) |
Nova Plugin | CELUM (min. version) |
---|---|
1.0.0 | 6.8.1 |
1.0.1 | 6.9.3 |
1.0.2 | 6.11.0 |
Released 2018-08-31
Initial version.
Released 2019-01-04
Display existing focal point on edit mask.
Released 2019-02-12
Added license.
Released 2019-02-15
Implemented FocalPointTranslator to allow access to focal point data in conversion processes.
Released 2020-02-17
Ready for CELUM 6.4