Description
The new Angular image editor (@dotcms/image-editor, built in #36063 / PR #36236) supports manual crop with aspect presets and orientation, but does not yet expose dotCMS's content-aware SmartCrop filter, which auto-crops an image to a target size by selecting the most relevant region.
Add a SmartCrop control to the editor. Like the rest of the editor, this is a server-side "viewer of the endpoint": the control builds a /contentAsset/image/... filter URL and the server renders it (no client-side pixel work).
Backend contract (already implemented — libvips-only)
The smartcrop filter is registered in com.dotmarketing.image.vips.VipsImageFilterApiImpl (.put("smartcrop", VipsSmartCropImageFilter.class)). It requires DOT_IMAGE_API_USE_LIBVIPS=true (no legacy fallback — same constraint as AVIF and the libvips Rotate filter).
URL form:
/contentAsset/image/{id}/{field}/filter/smartcrop/smartcrop_w/{w}/smartcrop_h/{h}/smartcrop_mode/{mode}
mode is one of attention | entropy | centre. Verified on stage (falconteam-image-editor.dotcms.dev):
.../filter/smartcrop/smartcrop_w/500/smartcrop_h/400/smartcrop_mode/attention
.../filter/smartcrop/smartcrop_w/500/smartcrop_h/400/smartcrop_mode/entropy
.../filter/smartcrop/smartcrop_w/500/smartcrop_h/400/smartcrop_mode/centre
| Mode |
Picks the region by |
attention |
Saliency — visually important areas (default) |
entropy |
Detail / busyness |
centre |
Geometric centre |
Surfacing
The exact placement — a mode inside the existing Crop tool vs a separate toolbar control — is deferred to the provided design. The acceptance criteria below are behavior-focused, not layout-specific.
Acceptance Criteria
Priority
Medium
Additional Context
Description
The new Angular image editor (
@dotcms/image-editor, built in #36063 / PR #36236) supports manual crop with aspect presets and orientation, but does not yet expose dotCMS's content-aware SmartCrop filter, which auto-crops an image to a target size by selecting the most relevant region.Add a SmartCrop control to the editor. Like the rest of the editor, this is a server-side "viewer of the endpoint": the control builds a
/contentAsset/image/...filter URL and the server renders it (no client-side pixel work).Backend contract (already implemented — libvips-only)
The
smartcropfilter is registered incom.dotmarketing.image.vips.VipsImageFilterApiImpl(.put("smartcrop", VipsSmartCropImageFilter.class)). It requiresDOT_IMAGE_API_USE_LIBVIPS=true(no legacy fallback — same constraint as AVIF and the libvips Rotate filter).URL form:
modeis one ofattention | entropy | centre. Verified on stage (falconteam-image-editor.dotcms.dev):.../filter/smartcrop/smartcrop_w/500/smartcrop_h/400/smartcrop_mode/attention.../filter/smartcrop/smartcrop_w/500/smartcrop_h/400/smartcrop_mode/entropy.../filter/smartcrop/smartcrop_w/500/smartcrop_h/400/smartcrop_mode/centreattentionentropycentreSurfacing
The exact placement — a mode inside the existing Crop tool vs a separate toolbar control — is deferred to the provided design. The acceptance criteria below are behavior-focused, not layout-specific.
Acceptance Criteria
attention,entropy,centre— defaulting toattention.W, heightH, modeMrenders a live preview built from…/filter/smartcrop/smartcrop_w/W/smartcrop_h/H/smartcrop_mode/M, like every other edit.Priority
Medium
Additional Context
DOT_IMAGE_API_USE_LIBVIPS=true(no legacy fallback). Where libvips is disabled the preview will error; detecting that from the frontend is out of scope here (a follow-up could hide/disable SmartCrop via a capability flag).