Image FromUrl and TransformBytes Example

This example creates an image from the specified url. The resulting byte-array is then transformed and send to the client.

Smartsite SXML CopyCode image Copy Code
<!--// set the url-->
{buffer.set(url,"http://docs.ixperion.smartsite.nl/")}

<!--// create image from url -->
{buffer.set(image, image.fromurl($url,1200,800,Jpeg))}

<!--// transform the image, using the byte-array -->
{buffer.set(image, image.transformbytes($image, "mxw=800;gs=1"))}

<!--// write result to the client -->
{response.contenttype("image/jpeg")}
{response.writebytes($image)}