【问题标题】:CQ5 - Get DAM image width and height for programmatic useCQ5 - 获取 DAM 图像宽度和高度以供编程使用
【发布时间】:2015-06-29 14:04:43
【问题描述】:

我在 CQ5 的 DAM 中有图像,我需要在 .jsp 中访问这些图像的宽度和高度以供编程使用。

【问题讨论】:

    标签: jsp jstl adobe aem dam


    【解决方案1】:

    您可以使用AssetDetails 类来获取特定 DAM 资产的详细信息。

    例如,

    Resource res = resourceResolver.getResource("<<path to resource>>"); 
    AssetDetails assetDetails = new AssetDetails(res);
    assetDetails.getHeight();
    assetDetails.getWidth();
    

    【讨论】:

      猜你喜欢
      • 2010-11-18
      • 1970-01-01
      • 2017-05-23
      • 2011-11-26
      • 1970-01-01
      • 1970-01-01
      • 2019-01-28
      • 2012-04-04
      • 1970-01-01
      相关资源
      最近更新 更多