DAM Workflow | Community
Skip to main content
New Participant
August 31, 2016
Solved

DAM Workflow

  • August 31, 2016
  • 4 replies
  • 2205 views

Hello Everyone,

I have requirement to create a workflow process which can be configured in dam update asset workflow.

When i uploaded a image into dam, this workflow is called and it will create 4 images on the fly with differnt dimensions. like Image_01 (1650 x 671 pixel), Image_02 (1650 x 917 pixel), Image_03 (1416 x 1200) and Image_04 (1650 x 917).

Am successull in duplicating the image with same dimensions but could not create the images with above resoultions, and also i need to have the same aspect ratios.

Please help AEM experts in achieving this. 

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 aem_dev1

You can generate images with thumbnail or web servlets using workflows (DAM update). Note that both servlets will always keep aspect ratio same. For example if you configure workflow to generate 1000x500, 800x800, 500x250 resolutions.

If image uploaded is 2000x2000, then workflow will generate three different renditions as per configuration. 

1000x500 will be generated , but the resolution will be 1000x1000. This is because uploaded image aspect ratio is 1:1

800x800 will be generated with proper resolution

500x250 will be generated, but resolution will be 500x500.

 

If user uploads 600x600 image

1000x500 will be generated , but the resolution will be 600x600. Renditons width & height will be always less than or equal to original image size and aspect ratio will be same 

800x800 will be generated, but resolution will be 600x600

500x250 will be generated, but resolution will be 500x500.

 

Hope above info will help you.

4 replies

aem_dev1
aem_dev1Accepted solution
New Participant
August 31, 2016

You can generate images with thumbnail or web servlets using workflows (DAM update). Note that both servlets will always keep aspect ratio same. For example if you configure workflow to generate 1000x500, 800x800, 500x250 resolutions.

If image uploaded is 2000x2000, then workflow will generate three different renditions as per configuration. 

1000x500 will be generated , but the resolution will be 1000x1000. This is because uploaded image aspect ratio is 1:1

800x800 will be generated with proper resolution

500x250 will be generated, but resolution will be 500x500.

 

If user uploads 600x600 image

1000x500 will be generated , but the resolution will be 600x600. Renditons width & height will be always less than or equal to original image size and aspect ratio will be same 

800x800 will be generated, but resolution will be 600x600

500x250 will be generated, but resolution will be 500x500.

 

Hope above info will help you.

smacdonald2008
New Participant
August 31, 2016

Here is a reference to the API. https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/dam/api/package-summary.html. I will add this to the Helpx community articles so we will have a good example of using this API. We have 1 helpx article that shows how to use the DAM API in an OSGi bundle and the depedencies to use. See https://helpx.adobe.com/experience-manager/using/downloading-dam-assets.html. For you use case, you want to use the DAM API in a custom workflow step. If you do not know how to build a custom workflow step, let me know.

Maddy737Author
New Participant
August 31, 2016

Thanks Smacdonald for quick reply.

 I have use JcrUtil.copy to copy the images. But am not sure how to resize. I tried few options but failed.

Could you please provide some sample code on how to resize using com.day.cq.wcm.foundation.Image or DAM apis.

This would highly appreciated.

Thanks

smacdonald2008
New Participant
August 31, 2016

Have you considered using the capability to write a custom WF step and use the AEM image APIs to modify the images. This would give you complete control over resizing images via a workflow. For example, com.day.cq.wcm.foundation.Image or DAM apis.