Expand my Community achievements bar.

SOLVED

How to retain width and height when uploading image on AEM

Avatar

Level 4
I am using image compression in AEM. It does compression, but changes the width and height of the image. There is option to give width and height of the image, but I don't want to change the options every time. I want this to be same as the original image. Is there any way to make it automatically get the size of the image.
Johann_Lu_0-1665631482946.png

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Johann_Lu,

This is not possible using OOTB workflow steps, it always requires width and height to produce valuable outcome. However you can write you own workflow step using Rendition Maker service:

Above service is used by OOTB workflow steps. In your implementation you will need to recognize original asset width and height of the image and use it in Rendition Maker.

You can also try to use Named Transform Image Servlet from ACS Commons, but this will be used outside workflow.

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @Johann_Lu,

This is not possible using OOTB workflow steps, it always requires width and height to produce valuable outcome. However you can write you own workflow step using Rendition Maker service:

Above service is used by OOTB workflow steps. In your implementation you will need to recognize original asset width and height of the image and use it in Rendition Maker.

You can also try to use Named Transform Image Servlet from ACS Commons, but this will be used outside workflow.