0

I want to use Adaptive Image Servlet and generate images of different qualities (25% low quality image and 82% actual image). I am using AEM6.3 We.Retail site, no custom components. When I hit We.Retail page

http://localhost:4502/content/we-retail/us/en/experience/arctic-surfing-in-lofoten.html?wcmmode=disabled

It loads an image

http://localhost:4502/content/we-retail/us/en/experience/arctic-surfing-in-lofoten/_jcr_content/root/responsivegrid/content_fragment/par3/image.img.75.1024.jpeg/1579280316937/fjord-waves.jpeg

This image has quality factor of 75% as in image.img.75.1024.jpeg. This 75% quality is dictated in component design policy here:enter image description here Once this quality is defined in policy, I am not able to generate same image with different quality. For example: http://localhost:4502/content/we-retail/us/en/experience/arctic-surfing-in-lofoten/_jcr_content/root/responsivegrid/content_fragment/par3/image.img.25.1024.jpeg/1579280316937/fjord-waves.jpeg

fails. I have to goto design policy, edit quality to 25% and then get the correct quality out.

My Requirement: I have an image overlay component that loads low quality image on page load and pans to higher quality on hover. How to use Adaptive Image Servlet and get images of different quality factors for same image component?

Update: Reading the AdaptiveImageServlet implementation, it is picking the quality from component policy. So let me rephrase my question. Is there an extension/config available to AdaptiveImageServlet, that accepts custom quality param?

Saravana Prakash
  • 1,321
  • 13
  • 25

1 Answers1

0

It looks like you will have to write your own extension for this class to extend the functionality.

ronnyfm
  • 1,973
  • 25
  • 31
  • 1
    unfortunately YES. this is what I ended doing. I wanted a hybrid version AdaptiveImageServlet from core and NamedImageTransformServlet from acs commons to get the flavour I needed. Wrote a custom image transform servlet that is working now. Thanks for your time. – Saravana Prakash Jan 20 '20 at 15:54
  • @SaravanaPrakash is there anyway you could share this code, I'm struggling to implement the AdaptiveImageServlet into one of my custom components. – ChazUK Dec 30 '21 at 16:06
  • Hi @ChazUK, this is how I did. Duplicated https://github.com/adobe/aem-core-wcm-components/blob/master/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/servlets/AdaptiveImageServlet.java. Changed selector to myimgtransform. Validated passing new selectors hits my selector. Then wrote all my custom logic inside doGet. – Saravana Prakash Jan 10 '22 at 22:39