How to get the dynamic renditions of the image? | Community
Skip to main content
Adobe Employee
January 9, 2023
Solved

How to get the dynamic renditions of the image?

  • January 9, 2023
  • 3 replies
  • 2276 views

Hi,

Does dynamic renditions of image gets stored in crxde? Is there anyway to get the dynamic renditions of image via java code instead of viewing it in the frontend of aem.

 

Thank you

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 Mohit_KBansal

You should try ACS commons Named Transform Image Servlet [1] to generate renditions dynamically. The generated renditions will not be saved in CRX, rather you can cache them on dispatcher/CDN/Client browsers.

 

[1] https://adobe-consulting-services.github.io/acs-aem-commons/features/named-image-transform/index.html

3 replies

Kiran_Vedantam
Community Advisor
Community Advisor
January 9, 2023

Hi @keerthana_h_n 

 

Can you please let me know what you mean by dynamic rendition? 

 

If you are just trying to get the renditions of the images stored in crxde that are created via workflow, you can use the below code: https://www.tabnine.com/code/java/methods/com.day.cq.dam.api.Asset/getRenditions

 

List<Rendition> renditions = asset.getRenditions();

 

Hope this helps!

 

Thanks,

Kiran Vedantam.

 

Adobe Employee
January 9, 2023

Hi @kiran_vedantam ,

Dynamic renditions as in image presets for images.

Kiran_Vedantam
Community Advisor
Community Advisor
January 9, 2023

If you want them to be refered in the BE code, you can try the example that I have shared.

Shashi_Mulugu
Community Advisor
Community Advisor
January 9, 2023

@keerthana_h_n hope are trying to get dynamic rendition urls and display them on your webpage, you can refer to AEM Image Core component implementation class for reference.

 

https://github.com/adobe/aem-core-wcm-components/blob/main/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/models/v1/ImageImpl.java

 

 

1. Check if image synced to scene7

2. If yes formulate base scene7 url and then use preset based on usagecontext <scene7domain>/is/image/accountname/image filename?$imagepresetname$

Mohit_KBansal
Adobe Employee
Mohit_KBansalAdobe EmployeeAccepted solution
Adobe Employee
January 10, 2023

You should try ACS commons Named Transform Image Servlet [1] to generate renditions dynamically. The generated renditions will not be saved in CRX, rather you can cache them on dispatcher/CDN/Client browsers.

 

[1] https://adobe-consulting-services.github.io/acs-aem-commons/features/named-image-transform/index.html