I have a requirement to build an API to make available to mobile app the images stored in AEM as assets. The tricky part is that the API must return the image rendition correct for the device screen size.
AEM have available the methods to determine the correct image rendition for the screen?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @daf99
You can use ACS's Named Image Transformer, as you are thinking to create API, with this feature, you will not have to create API end you will just have to call image path with your custom transformer.
https://varunaem.blogspot.com/2019/03/acs-commons-tools-part-1.html
There is similar query discussed in post https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-access-image-rendit.... This might help.
Thanks!
Nupur
Hi @daf99
You can use ACS's Named Image Transformer, as you are thinking to create API, with this feature, you will not have to create API end you will just have to call image path with your custom transformer.
https://varunaem.blogspot.com/2019/03/acs-commons-tools-part-1.html
There is similar query discussed in post https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-access-image-rendit.... This might help.
Thanks!
Nupur
......
Views
Replies
Total Likes
................
Views
Replies
Total Likes
Hi @Nupur_Jain,
In first place thank you for the help.
I saw the link's that you advice, but what i am looking is a bit different.
I want to build an API that receives an image/asset identifier and some header or property with the screen size. With this 2 parameters i want to be able to get the image and the rendition that fit's the device ecran size.
For this i think that i need to have a way to calculate the rendition correct to the device screen size. AEM should have a way to do it, because it's made when we use images in portal the image used it's rendition for the screen size. My objective is to do the same implementation for this API to share the images with the mobile application.
Do you think that this possible?
Views
Replies
Total Likes
I am not aware of such api/library available in AEM. AEM Sites pages uses adaptive images whicch basically on the fly resize the image as per image size. The is Core core Image component which you can refer to understand the functionality better.
I would say why don't you write your own functionality. You can use DAM asset API to get all renditions availabble for asset and on the basis of some logic, can choose better rendition.
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies