Problem/Motivation
I would like to prevent a content author from resizing a media item below or above certain widths when using the resizing handles in CKEditor5. It would be beneficial if these values could be set either via configuration or in the CMS via a settings form.
Steps to reproduce
Images can be resized to very large sizes, e.g. 3000+ pixels in width, by dragging the resizing handle over to the right.
Proposed resolution
Prevent the user from resizing to extremes with a set minimum and maximum pixel width, provided through configuration or settings forms.
Issue fork ckeditor_media_resize-3398133
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 #4
drpldrp commentedNote that this MR also includes fix for https://www.drupal.org/project/ckeditor_media_resize/issues/3409595.
Comment #5
damienmckennaThank you for the merge request.
Comment #6
damienmckennaThis looks really good, thank you.
I think there should be some protection around the min_width and max_width values, so that if invalid values are added they are ignored.
Comment #7
damienmckennajulien_capybara worked on a similar issue that only enforced a maximum size: #3507466: Resized media max width
Comment #8
damienmckenna