Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to get width and height of remote images from Next Generation Dynamic Media remote assets

Avatar

Level 3

We have Next Generation Dynamic Media set up, so we can select and use remote images for any of components that may contain an image. I'm trying to figure out how I can get the width and height of this image if it is remote.

 

I know how to do it with local images by checking the renditions, but I'm not sure what to do for remote images. I was thinking of just using the image url with BufferedReader to get the image details, but I was wondering if there's some built in way to do it through one of Adobe's libraries. 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@IshaJa i assume when you say remote, you mean from DM. If you have enabled the smart crop in DM and the renditions are created , it will be available in DM. You can check the different renditions from DM using ?req=set,json at the end of the DM Image URL. 

Again if you have smart crop , you already know what rendition to deliver for an image for different form factors

 

ex: https://s7d1.scene7.com/is/image/siliconlabssandbox/WW-Summit-Reg-Banner-2000x870?req=set,json 

 

Smart Crop : https://experienceleague.adobe.com/docs/experience-manager-learn/assets/dynamic-media/images/smart-c... 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

@IshaJa i assume when you say remote, you mean from DM. If you have enabled the smart crop in DM and the renditions are created , it will be available in DM. You can check the different renditions from DM using ?req=set,json at the end of the DM Image URL. 

Again if you have smart crop , you already know what rendition to deliver for an image for different form factors

 

ex: https://s7d1.scene7.com/is/image/siliconlabssandbox/WW-Summit-Reg-Banner-2000x870?req=set,json 

 

Smart Crop : https://experienceleague.adobe.com/docs/experience-manager-learn/assets/dynamic-media/images/smart-c...