0
votes

Basic Challenge is as follows...please help if you can:

AEM 6 DAM - we want the DAM to automatically create various image renditions for each of mobile, tablet and desktop breakpoints. We want to preserve aspect ratio. We do not want to mandate the size/aspect ration of images that are uploaded to the DAM or used on the site.

There don't seem to be many sizing options apart from assigning both exact Width and Height for each rendition in pixels.

Will this mean that images are stretched or cropped if they don't fit the size exactly? Or, hopefully, does AEM give precedence to the WIDTH and allow the height to flow to maintain aspect ratio?

Your help on this, and on how best to execute this simply using the workflow so that the renditions are created automatically on upload, would be much appreciated.

Thanks, Sentry1

UPDATE:::::: It appears that editing the 'Thumbnail' step of the out of the box Workflow for "DAM Update Asset" with [height,width] of the rendition in question actually preserves the aspect ratio whatever the initial height and width and creates a rendition based on whichever of the H or W is the smaller. Does anyone agree?

2

2 Answers

1
votes

This is correct - as per the RenditionMaker interface in DAM API:

The aspect ratio of the assets base image will be preserved. Depending on orientation, either width or height of the target size will be smaller.

http://docs.adobe.com/content/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/dam/api/renditions/RenditionMaker.html

-1
votes

Another option could be to use ootb adaptive image component instead of creating renditions on upload.

http://blogs.adobe.com/experiencedelivers/experience-management/cq_5_6_and_responsivedesign0/ https://docs.adobe.com/docs/en/cq/5-6-1/developing/mobile/responsive.html

That way you don't fill your DAM with such renditions.