Image Resize Example

The image macro provides various properties for resizing images. You can specify a width and/or height of an image and you can specify whether the aspect ratio of the image should be preferred. Furthermore, the minimum and maximum size of an image can be restricted. The maximum width and height is typically defined in the smartsite.imageprocessor.config. The constraints defined in the smartsite.config cannot be overridden in the macro. And finally you can set the resize mode.

The following sample will result in an image of 100px by 100px where the aspect ratio is not preserved and the used resize mode is Gaussian Filter.

Smartsite SXML CopyCode image Copy Code
<se:image
    location="SMARTSITELOGO"
    width="200"
    height="100"
    maxwidth="100"
    minheight="100"
    aspectratio="false"
    resizemode="gaussianfilter"/>
Example Result CopyCode image Copy Code
<img src="/test.net?id=SMARTSITELOGO&amp;hid=img;w=200;h=100;mxw=100;mnh=100;ar=0;rm=8" alt="Smartsite Logo Transparent" style="width:100px;height:100px" />