Expand my Community achievements bar.

SOLVED

Need aspect ratio or height and width for video during video upload in eDAM

Avatar

Level 4

Hi All,

When we upload image in eDAM, Metadata Processor(com.day.cq.dam.core.process.MetadataProcessorProcess - CQ5 out of box workflow process) is extracting metadata details(image length and width.. etc) for the image.

Is it possible to get aspect ratio or height or width for the video when we upload video in eDAM ?

Thanks

Sankar

1 Accepted Solution

Avatar

Correct answer by
Administrator

Hi 

I am not sure if this would help you.

But you can try, 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();

Documentation :- https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/wcm/resource/details/AssetDeta...

I hope this will help you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

View solution in original post

3 Replies

Avatar

Correct answer by
Administrator

Hi 

I am not sure if this would help you.

But you can try, 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();

Documentation :- https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/wcm/resource/details/AssetDeta...

I hope this will help you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Level 10

As Kautuk suggest - use the API and write a custom step and add that step to the given workflow. 

Avatar

Administrator

Adding more reference:-

1. https://github.com/AdobeAtAdobe/aem-spa-example/blob/master/modules/application/jcr_root/apps/aaa/te...

// This is code example of Video component. 

            public Long getAvsRenditionWidth(Rendition rendition){
                    ValueMap renditionValueMap = rendition.getChild("jcr:content").getChild("metadata").getValueMap();
                    return renditionValueMap.get("width",Long.class);
               }

2. https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/dam/commons/util/UIHelper.html

//This class provides various utility methods pertaining to DAM required in presentation/user interface.

I hope this will also help you.

~kautuk



Kautuk Sahni