Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limiting image resize #5199

Open
mlewand opened this issue Aug 27, 2019 · 4 comments
Open

Limiting image resize #5199

mlewand opened this issue Aug 27, 2019 · 4 comments
Labels
package:image status:discussion type:feature This issue reports a feature request (an idea for a new functionality or a missing option).

Comments

@mlewand
Copy link
Contributor

mlewand commented Aug 27, 2019

Is this a bug report or feature request?

🆕 Feature request

💻 Version of CKEditor

CKEditor v5 @ 12.4.0

📋 Steps to reproduce

During the course of #5167 a suggestion of limiting image resize appeared.

It make sense to expose this feature in the image configuration.

  • Is there a need to limit both min and max value?
  • UX: How user should be hinted that limit has been reached and further resizing won't change the size?

If you'd like to see this feature implemented, add 👍 to this post.

@mlewand mlewand transferred this issue from ckeditor/ckeditor5-image Oct 9, 2019
@mlewand mlewand added this to the backlog milestone Oct 9, 2019
@mlewand mlewand added status:discussion type:feature This issue reports a feature request (an idea for a new functionality or a missing option). package:image labels Oct 9, 2019
@pomek pomek removed this from the backlog milestone Feb 21, 2022
@dtdesign
Copy link

dtdesign commented Aug 1, 2023

I was looking for a solution for this because there is little value of increasing the width of an image beyond its intrinsic size, at least in our use case. A simple yet elegant solution is to apply a max-width attribute with a matching pixel size. This will cause the resize operation to stop at the defined limit regardless of how far the handle is being “dragged”.

In terms of UX the resizing will simply stop at some point and is something I have observed before. I don’t think that there needs to be some special hint because the user can observe the behavior and draw a conclusion. You could always add another tooltip along the indicator for the dimensions that will inform the user that the maximum width has been reached.

@dtdesign
Copy link

dtdesign commented Aug 1, 2023

In case someone else comes across this issue, this is how I solved this by enforcing the max-width of resizable images:
https://github.com/WoltLab/editor/blob/1b0af7fe54e26d70d87a792a174c8c68a98f6416/plugins/ckeditor5-woltlab-image/src/woltlabimage.ts#L54-L91

@CKEditorBot
Copy link
Collaborator

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

@CKEditorBot CKEditorBot added status:stale status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. labels Aug 1, 2024
@psmyrek psmyrek removed status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. labels Aug 1, 2024
@Bapawe
Copy link

Bapawe commented Aug 1, 2024

In terms of UX, keep in mind to disable the buttons for predefined widths (resizeOptions) when they exceed the intrinsic size of the image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:image status:discussion type:feature This issue reports a feature request (an idea for a new functionality or a missing option).
Projects
None yet
Development

No branches or pull requests

6 participants