Focal Point Setter

For the most up-to-date documentation, please visit docs.brix.ch

The "Focal Point Setter" plugin allows the user to set the focal point of images.

Properties

To be configured in {home}/appserver/conf/custom.properties

focalPointSetter.license

type: String, required: yes, default: -, since v1.2.0

The license for the product (provided by brix cross media).

focalPointSetter.supportedAssetTypes

type: List of String (comma-separated), required: yes, default: -

A list of supported asset type ids.

focalPointSetter.allowedUserGroups

type: List of String (comma-separated), required: false, default: - (only super admins)

A list of user groups for which the menu entry is visible.

focalPointSetter.infofield.horizontal

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.

focalPointSetter.infofield.vertical

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.

focalPointSetter.actionMenuEnabled

type: Boolean, required: no, default: false

Specifies whether an entry is added to the action menu or not.

Export format integration

In order to use the defined focal points in export formats, you have to edit home/appserver/spring/conversionProcessDefinitions.xml as following:

  1. 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>
  2. 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 will be disabled and have to be re-enabled in the CMA.

Compatibility Matrix

Focal Point Setter CELUM
1.0 5.13.3
1.3.7 5.13.4 (tested 6.4)

Release Notes

1.0.0

Released 2018-08-31

Initial version.

1.1.1

Released 2019-01-04

Display existing focal point on edit mask.

1.2.0

Released 2019-02-12

Added license.

1.3.6

Released 2019-02-15

Implemented FocalPointTranslator to allow access to focal point data in conversion processes.

1.3.7

Released 2020-02-17

Ready for CELUM 6.4