How to retain width and height when uploading image on AEM | Community
Skip to main content
Level 4
October 13, 2022
Solved

How to retain width and height when uploading image on AEM

  • October 13, 2022
  • 1 reply
  • 691 views
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.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by lukasz-m

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.

1 reply

lukasz-m
Community Advisor
lukasz-mCommunity AdvisorAccepted solution
Community Advisor
October 17, 2022

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.