0

I have images in the DAM in CQ5 and I need to access the width and height of these images inside a .jsp for programmatic use.

midda25
  • 152
  • 1
  • 2
  • 12

1 Answers1

2

You can use the AssetDetails class to get the details of a particular DAM Asset.

For e.g.,

Resource res = resourceResolver.getResource("<<path to resource>>"); 
AssetDetails assetDetails = new AssetDetails(res);
assetDetails.getHeight();
assetDetails.getWidth();
rakhi4110
  • 9,253
  • 2
  • 30
  • 49