Description
The new Angular image editor (#36063 / PR #36236) originally had a focal-point picker. It was removed during development; this issue re-adds it.
What a focal point is / why it matters
A focal point is a normalized (x, y) anchor stored on the asset's metadata. When any downstream crop/resize renders the image at a different size or aspect ratio without explicit crop coordinates, dotCMS centers the crop on the stored focal point instead of the geometric center (CropImageFilter.calcFocalPoint → FocalPointAPI.readFocalPoint).
So an editor marks the "keep-in-frame" point once, and every auto-generated rendition across the site (cards, thumbnails, responsive srcset, social previews) keeps the subject in frame. It is the editorial/manual counterpart to SmartCrop's automatic region detection (#36315).
Backend contract (already implemented)
- Persist:
…/filter/FocalPoint/fp/{x},{y}/?overwrite={n} → FocalPointImageFilter calls FocalPointAPI.writeFocalPoint(inode, field, fp), writing the focal point to the asset metadata. fp is normalized floats 0..1 (e.g. 0.42,0.31).
- Consume: subsequent crops/resizes with no explicit x,y read it via
readFocalPoint and center the crop on it.
Reference
The prior implementation lived in DotImageEditorFocalOverlayComponent + a with-focal-point store feature + a FocalPoint entry in the URL builder/model — all removed in PR #36236. Git history has the working version to restore from.
Scope
The draggable picker UI plus persisting the focal point to the asset metadata. A focal-point-centered crop preview inside the editor (cropping to ratios to visualize the effect) is out of scope (possible follow-up).
Acceptance Criteria
Priority
Medium
Additional Context
Description
The new Angular image editor (#36063 / PR #36236) originally had a focal-point picker. It was removed during development; this issue re-adds it.
What a focal point is / why it matters
A focal point is a normalized
(x, y)anchor stored on the asset's metadata. When any downstream crop/resize renders the image at a different size or aspect ratio without explicit crop coordinates, dotCMS centers the crop on the stored focal point instead of the geometric center (CropImageFilter.calcFocalPoint→FocalPointAPI.readFocalPoint).So an editor marks the "keep-in-frame" point once, and every auto-generated rendition across the site (cards, thumbnails, responsive srcset, social previews) keeps the subject in frame. It is the editorial/manual counterpart to SmartCrop's automatic region detection (#36315).
Backend contract (already implemented)
…/filter/FocalPoint/fp/{x},{y}/?overwrite={n}→FocalPointImageFiltercallsFocalPointAPI.writeFocalPoint(inode, field, fp), writing the focal point to the asset metadata.fpis normalized floats0..1(e.g.0.42,0.31).readFocalPointand center the crop on it.Reference
The prior implementation lived in
DotImageEditorFocalOverlayComponent+ awith-focal-pointstore feature + aFocalPointentry in the URL builder/model — all removed in PR #36236. Git history has the working version to restore from.Scope
The draggable picker UI plus persisting the focal point to the asset metadata. A focal-point-centered crop preview inside the editor (cropping to ratios to visualize the effect) is out of scope (possible follow-up).
Acceptance Criteria
0..1for both x and y, independent of the current zoom/pan.…/filter/FocalPoint/fp/{x},{y}/?overwrite=…(normalized floats), so downstream crops/resizes center on it.Priority
Medium
Additional Context
DotImageEditorFocalOverlayComponent,with-focal-point.feature, and theFocalPointentry in the URL builder/model.