How do I create a new image transformer?

Avatar

Avatar

jkpanera

Avatar

jkpanera

jkpanera

08-01-2020

Hi guys,

 

We have been creating new image transforms using the ACS class com.adobe.acs.commons.images.impl.NamedImageTransformerImpl. Very nice, you just create a new OSGI component configuration as follows:

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
name="tablet"
transforms="[crop:bounds=288\,0\,2304\,959,bounded-resize:width=768&amp;height=320,quality:quality=75,progressive:enabled=true]"
jcr:primaryType="sling:OsgiConfig"/>

 

and the transforms crop, bounded-resize, quality, and progressive are executed on the fly against the original image.

 

Okay, great. But limited. Now I need to create a new image transformer. I can do so by implementing the interface com.adobe.acs.commons.images.ImageTransformer, but I can't get the classes NamedTransformImageServlet or NamedImageTransformImpl to pick it up.

 

I think the ImageTransformer implementations get injected with the methods, NamedTransformImageServlet.bindImageTransformers and NamedImageTransformImpl.bindImageTransformers but I can't make the bundle pick up my implementation.

 

Any help?

Accepted Solutions (0)

Answers (0)