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

feat: Limit max width/height of resize to the image to disallow upscaling #645

Merged
merged 1 commit into from
Jul 13, 2022

Conversation

maldoinc
Copy link
Contributor

Please check if the PR fulfills these requirements

  • It's submitted to right branch according to our branching model
  • It's right issue type on title
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • It does not introduce a breaking change or has description for the breaking change

Description

Hi all, in this PR I propose a change to the resize module. Currently the sliders allow resizing up to 4088px (Any particular reason or just arbitrary?); after this patch the images will not be able to be resized over 100% to disallow upscaling. Not only does the application become laggy when resizing the image above its original dimensions but there is also little to no benefit for it.

Of course this could also be an option instead of being the default forced behavior but I'm open to discussion.

@lja1018
Copy link
Contributor

lja1018 commented Oct 1, 2021

@maldoinc
Thank you for your contribution.
The '4088px' is an arbitrarily determining size.
One question is, when resizing, Is the size of the image 100% of the original? Is it 100% of the current size?

@maldoinc
Copy link
Contributor Author

The maximum width/height allowed will be that of the original image contents regardless of the canvas size.

@lja1018
Copy link
Contributor

lja1018 commented Oct 21, 2021

@maldoinc
Someone may want to grow it than the original image.
How about allowing it to be changed up to twice the original image?

@maldoinc
Copy link
Contributor Author

I think that is a decision that the project maintainers should decide on and even then why limit it to only 2x?

We are using this as part of a system where users can upload images up to a certain size and the editor is used by the users to perform some light manipulations. Upscaling images would result in blurry, larger in size and possibly exeeding the maximum image size allowed by the system, overall not too attractive for a cloud solution.

In the end it really depends on how you and/or your users use the editor, but I'm of the opinion that at the very least there should be an option to disallow upscaling.

@lja1018
Copy link
Contributor

lja1018 commented Oct 27, 2021

@maldoinc
I think it's right.
I think there is no reason for the image to be larger than the size of the original.
It only degrades the quality of the image.

@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as inactive because there hasn’t been much going on it lately. It is going to be closed after 7 days. Thanks!

@stale stale bot added the inactive label Jan 9, 2022
@maldoinc
Copy link
Contributor Author

@lja1018 Any updates on this? Do we think upscaling should be on by default?

@stale stale bot removed the inactive label Jan 16, 2022
@lja1018
Copy link
Contributor

lja1018 commented Jan 19, 2022

@maldoinc
I'm sorry for the late reply. It'll be merged in a few days. Thank you for your PR. 👍

@stale
Copy link

stale bot commented Mar 30, 2022

This issue has been automatically marked as inactive because there hasn’t been much going on it lately. It is going to be closed after 7 days. Thanks!

@stale stale bot added the inactive label Mar 30, 2022
@stale
Copy link

stale bot commented Apr 17, 2022

This issue will be closed due to inactivity. Thanks for your contribution!

@stale stale bot closed this Apr 17, 2022
@maldoinc
Copy link
Contributor Author

Ping @lja1018

@lja1018 lja1018 reopened this Jul 13, 2022
@stale stale bot removed the inactive label Jul 13, 2022
@lja1018
Copy link
Contributor

lja1018 commented Jul 13, 2022

@maldoinc
Sorry, I'm late. I merged this PR.
Once again, I'm sorry I'm late.

@lja1018 lja1018 merged commit 95ab1de into nhn:master Jul 13, 2022
@maldoinc maldoinc deleted the feat/disallow-resize-upscaling branch November 15, 2022 18:24
YusakuNo1 added a commit to YusakuNo1/tui.image-editor that referenced this pull request Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants