Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

AEM Cloud Service - Dynamic Media Process New Smart Crops | AEM Community Blog Seeding




AEM Cloud Service - Dynamic Media Process New Smart Crops by Sreekanth Choudry Nalabotu


AEM Cloud Version : 2021.2.4944.20210221T230729Z-210225 (Feb 21, 2021)

When new smart crop settings are added in Image Profile, assets have to be reprocessed to see the new crops (otherwise they show unprocessed). However reprocessing results in generating all crops again, so any manual adjustments made to the previous crops by creatives get overwritten. This post explains how to preserve the manually adjusted smart crops, and generate new unprocessed ones...for scene7 api check this documentation

1) Add a datasource to read the existing smart crops /apps/eaem-cs-process-new-smart-crops/extensions/smart-crop-renditions

<%@include file="/libs/granite/ui/global.jsp"%>

<%@page session="false"
<%@ page import="com.adobe.granite.ui.components.ds.DataSource" %>
<%@ page import="" %>
<%@ page import="" %>

ValueMap dynVM = null;

JSONObject dynRenditions = new JSONObject();
Resource dynResource = null;

DMCService dmcService = sling.getService(DMCService.class);

DataSource rendsDS = null;

rendsDS = cmp.getItemDataSource();
}catch(Exception e){
//could be pixel crop, ignore...

if(rendsDS == null){

for (Iterator items = rendsDS.iterator(); items.hasNext();) {
JSONObject dynRendition = new JSONObject();

dynResource =;

dynVM = dynResource.getValueMap();

String name = String.valueOf(dynVM.get("breakpoint-name"));

dynRendition.put("name", name);
dynRendition.put("cropdata", getCropData(dynVM));

dynRenditions.put(name, dynRendition);


private static JSONArray getCropData(ValueMap dynVM) throws Exception{
JSONArray cropArray = new JSONArray();
JSONObject cropData = new JSONObject();

cropData.put("name", String.valueOf(dynVM.get("breakpoint-name")));
cropData.put("id", dynVM.get("id"));
cropData.put("topN", dynVM.get("topN"));
cropData.put("bottomN", dynVM.get("bottomN"));
cropData.put("leftN", dynVM.get("leftN"));
cropData.put("rightN", dynVM.get("rightN"));


return cropArray;

2) To get the smart crops as json send the asset path as resource suffix to data source eg.

Read Full Blog

AEM Cloud Service - Dynamic Media Process New Smart Crops


Please use this thread to ask the related questions.


Topics help categorize Community content and increase your ability to discover relevant content.

0 Replies

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now