Make it possible to reset media picker crops #18110
Merged
+25
−18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisites
If there's an existing issue for this PR then this fixes #12135
Description
This PR makes it possible to reset (remove) local crops from a media picker.
As-is, the media picker will forcefully overwrite the crop with the defaults when one attempts to reset the crop. This efficiently makes it impossible to "inherit" existing crops from the original image once a corresponding local crop has been created.
With this PR, the "reset crop" functionality literally resets (and removes) the crop. For comparison, this is how the image cropper works, and this is also how the media picker works in V14+ 👍
Note that I also experienced issues with the default image focal point going missing after saving a document. This happens because the media picker value editor explicitly strips out the default focal point ... so this should really be fixed serverside. However, I'm afraid this will have consequences at a later point, when V13 changes are forward merged to V14+, so I have opted to fix it clientside instead 😄
Testing this PR
Test template