applicationcontext image

Crop image - Changing default sizes options

Question

I want to change the default sizes when selecting the option crop image. Is there an easy way to do it without redeploying application?

Answer

Yes, the sizes can be easily changed. To do so you just need to override the following ImageCrop.predefinedSizes list definition from our core package:

<util:list id="ImageCrop.predefinedSizes">
        <!-- each value is a String of format [width]x[height] -->
        <value>120x90</value>
        <value>160x120</value>
        <value>200x150</value>
        <value>320x240</value>
        <value>400x300</value>
        <value>640x480</value>
        <value>1024x600</value>
        <value>1024x768</value>
        <value>1200x900</value>
        <value>1280x800</value>
        <value>1280x1024</value>
        <value>1366x768</value>
        <value>1440x900</value>
        <value>1600x1200</value>
        <value>1920x1080</value>
</util:list>

Once you edit this list with the values you want you can simply add this list definition in digital-factory-config/jahia/applicationcontext-custom.xml and then restart Jahia.