Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

How do I create a new image transformer?

jkpanera
Level 5
Level 5

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?

0 Replies