Skip to content

v1.6.0

Choose a tag to compare

@marco910 marco910 released this 16 Nov 17:15
· 9 commits to master since this release

In this release we're adding support for two new features: the watermark filter and option to use React.createRef with the ImageHandler component.

The new watermark property is available in the filter prop of the ImageHandler component. It allows you to add an image from the ImageManager as a watermark to the new generated image.
For that, the following properties are required in the filter object for watermark:

  • key: relative image URL of the ImageManager image to use as watermark
  • x: x position of the watermark
  • y: y position of the watermark
    Additionally, you can specify an alpha channel value (watermark.alpha) as well as a width and height of the watermark relative to the optimized image's width/height using watermark.wRatio and watermark.hRatio.

To use the ref feature on the ImageHandler component, you can simply pass a reference to the ref prop on ImageHandler component as on every other HTML element or component (that supports refs) in React.