Problem/Motivation
When a user updates the focal point on a DAM media entity via the media edit form, the previously generated image style derivatives are not invalidated. This means the old cropped images continue to be served even after the focal point has been changed.
Steps to reproduce
- Create or edit a media entity using an Acquia DAM asset.
- Set a focal point for an image style.
- Save the form.
- Edit the media again and change the focal point to a different position.
- Save the form.
- Observe that the image style derivative still shows the old crop.
Expected behavior
After updating the focal point crop, the image style for the associated DAM asset URI should be flushed so that the newly cropped derivative is generated on next request.
Proposed resolution
After calling FocalPointMediaEditFormAlter::updateCrop(), load the corresponding ImageStyle entity and call flush() with the original DAM asset URI (acquia-dam://{asset_id}/{version_id}), ensuring stale derivatives are cleared.
Issue fork acquia_dam-3584070
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
rajeshreeputraRequesting review.
Comment #4
rajeshreeputraComment #6
rajeshreeputraMerged!