Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

DAM Workflow

Avatar

Level 4

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. 

1 Accepted Solution

Avatar

Correct answer by
Level 3

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.

View solution in original post

4 Replies

Avatar

Level 10

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.

Avatar

Level 4

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

Avatar

Level 10

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.

Avatar

Correct answer by
Level 3

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.