Dynamic media - asset properties | Community
Skip to main content
Level 2
November 17, 2023
Solved

Dynamic media - asset properties

  • November 17, 2023
  • 2 replies
  • 1412 views

hi all,

 

I'm trying to get image DPI from dynamic media using java api

It is possible using

https://scene7.com/is/image/client/image?req=props,json

 

I need to get image props using scene7 api, think I found api that I need but need code examples, can't figure out from the doc how to create proper call.

This should be the method

getAsset​(java.lang.String assetHandle, java.lang.String[] responseFields, java.lang.String[] excludeFields, S7Config s7Config)

from 

https://developer.adobe.com/experience-manager/reference-materials/cloud-service/javadoc/com/day/cq/dam/scene7/api/Scene7Service.html

 

In the response I'll get Scene7Asset

https://developer.adobe.com/experience-manager/reference-materials/cloud-service/javadoc/com/day/cq/dam/scene7/api/model/Scene7Asset.html

 

and further I can use  getAssetProperties to get info that I need.

 

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 Saravanan_Dharmaraj

BTW, Core component makes the call to req=set,json to get the smart crop rendition in client side before delivering the image in the html. You can do props calls incase if you are doing it from front end. 

https://github.com/adobe/aem-core-wcm-components/blob/main/content/src/content/jcr_root/apps/core/wcm/components/image/v3/image/clientlibs/editor/js/image.js#L373

 

2 replies

Saravanan_Dharmaraj
Community Advisor
Community Advisor
November 20, 2023

@nbg19a You can reference the Interface just like you are doing for other services in AEM

 

@Reference
private Scene7Service s7service;

Same for S7Config too and then make the method calls. Make sure you have the DM S7 configured in the AEM instance the code is running otherwise s7service  returns null. 

 

Saravanan_Dharmaraj
Community Advisor
Saravanan_DharmarajCommunity AdvisorAccepted solution
Community Advisor
November 20, 2023

BTW, Core component makes the call to req=set,json to get the smart crop rendition in client side before delivering the image in the html. You can do props calls incase if you are doing it from front end. 

https://github.com/adobe/aem-core-wcm-components/blob/main/content/src/content/jcr_root/apps/core/wcm/components/image/v3/image/clientlibs/editor/js/image.js#L373

 

kautuk_sahni
Community Manager
Community Manager
November 23, 2023

@nbg19a Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni