JavaScript Image Scaling

To use JavaScript Image Scaling, the images option for the URL API has to be activated:

<config>
  <js-api>
    <url images="true" />
  </js-api>
</config>

The scaling of images in JavaScript is accomplished via the ai.urls.composeImageUrl() function and supports all the parameters described in Image Scaling.

An example for the usage of the JavaScript URL API:

var img_src = ai.urls.composeImageUrl('foo.jpg', {'scaling-width': '50%', quality: 80});

See the JavaScript URL API for details.