5 Replies Latest reply on Jul 26, 2012 8:57 AM by stewa52

    How to auto crop an image?


      How do you auto crop an uploaded image?  I see that there are workflow steps and it seems there might be a couple that can create new assets, but where is the documentation for that? 


      Also, how do you set the auto crop aspect ratio for the html4image widget?

        • 1. Re: How to auto crop an image?
          Sham HC Level 7

          You can see example at the existing image component by adding more aspect ratios using the "cropConfig" node. Please reference one under - "/libs/cq/packaging/components/pack/definition/dialog/items/tabs/items/tab3/cropConfig". In this manner, you can add in more option and specify the required height/width.



          • 2. Re: How to auto crop an image?
            stewa52 Level 1

            I don't seem to have that path in my CQ installation.  Is there a documentation page that outlines this feature?  Can I make it so that the crop aspect ratio is mandatory or automatically applied to an image with the ability to change the crop location later? 

            • 3. Re: How to auto crop an image?
              Sham HC Level 7

              I think you can modify the workflow model to apply aspect ratio & some custamization to apply later. I will do little research to see if it exists in cq 5.5 & to confirm if it is lacking documentation for this feature.

              • 4. Re: How to auto crop an image?

                Creating a different renditions (or different size images) at the time of uploading dam asset can be achieved by modifying the

                existing DAM workflow.

                Follow the given steps to modify DAM workflow.

                1. Go to workflow console


                1. Go to Models Tab
                2. Find "DAM Update Asset" workflow and edit the workflow It will take you to the detailed page.
                3. Find "Thumbnail creation" process step, Double click on it
                4. A dialog will open; Go to Second Tab (Process). There you will find "Arguments" for aspect ratios of images
                5. Here you can specify Aspect Ratio at which you want to auto crop the dam assest while uploading.
                6. Click Save.


                These steps are same for both the CQ version 5.4 and 5.5              .




                • 5. Re: How to auto crop an image?
                  stewa52 Level 1



                  It seems that when I use the thumbnail creation it will crop the entire image to fit into that aspect ratio.  The image will have extra white space on the top and bottom if I try and crop to an protrait landscape rather than cropping out the image.