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

Add constrain proportions when modifying image size #21918

Closed
dingo-d opened this issue Apr 27, 2020 · 9 comments
Closed

Add constrain proportions when modifying image size #21918

dingo-d opened this issue Apr 27, 2020 · 9 comments
Labels
[Block] Image Affects the Image Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi Needs Dev Ready for, and needs developer efforts [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@dingo-d
Copy link
Member

dingo-d commented Apr 27, 2020

Is your feature request related to a problem? Please describe.

When you add an image, you have the option to resize it - either manually by entering width/height, or by selecting a percentage.

When you are using manual resizing, sometimes (or maybe always) you'd want to keep the correct proportions, otherwise, your image will be squashed.

Screenshot 2020-04-27 at 14 36 46

Describe the solution you'd like

A good thing to have, above or below the Image dimensions option, would be to have a checkbox that says: Constrain Proportions. In Sketch, it's denoted by a lock (I think in Adobe products as well), and Figma has that on the right side as a lock.

Describe alternatives you've considered

I didn't think of alternatives as this should be added to the core IMO.

@karmatosed
Copy link
Member

Interesting idea @dingo-d. My first thought is that because you have the ability to change size and percentage, it might be ok to allow more macro-control without constraint here. If that's not the case, then maybe we could take a slightly different approach to an option or lock and have it auto-resize once a width is put in, then you have to over-ride the constraint? Just an option to maybe iterate here.

@karmatosed karmatosed added the Needs Design Feedback Needs general design feedback. label Apr 27, 2020
@dingo-d
Copy link
Member Author

dingo-d commented Apr 27, 2020

More granular percentage option might work, current 4 options oftentimes don't cut it.

I worry that auto-resizing, then override could be weird for users. The constraint lock is something that is widely used in design tools I think, so it's something that is known to many and seems to be a good UX.

I'd love to see more iterations on this definitely 🙂

@skorasaurus skorasaurus added the [Block] Image Affects the Image Block label Jan 29, 2021
@paaljoachim
Copy link
Contributor

Constraining the image dimensions proportions is a very good idea!
Here is a quick sketch.

Image-dimension-aspect-ratio-lock

@paaljoachim paaljoachim added Needs Dev Ready for, and needs developer efforts and removed Needs Design Feedback Needs general design feedback. labels Feb 10, 2021
@kellychoffman
Copy link
Contributor

A few thoughts:

The link icon is used more consistently across image editing tools. Lock could make it appear like you are unable to edit the dimensions.

The interaction should clearly be a toggle. I don't believe we have any icon toggles, but we do have the toggle bar below with text. If we draw from that, an updated design suggestion would be:

Screen Shot 2021-02-10 at 9 25 54 AM

Using the current icon component, it would appear something like this, which is not as obvious but doable:

Screen Shot 2021-02-10 at 9 33 42 AM

Should also include a tooltip when hovered that says "Constrain proportions".

@mtias
Copy link
Member

mtias commented Feb 23, 2021

Also related: #27331

@swinggraphics
Copy link

swinggraphics commented Mar 23, 2021

The current behavior is very confusing. If you change one value, the image resizes proportionally, but the value of the other field does not change. For example, if you start with an image that is 800x800 and change the width to 250, the image will actually be 250x250, but the Height value in the settings panel remains 800.

Edit: There's an additional bug: If you delete the value in one of the fields, it will cause an error when the block loads in the editor, outputting NaN, and causing the "This block contains unexpected or invalid content" message to appear.

@mtias mtias added [Type] Enhancement A suggestion for improvement. [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi labels Jun 25, 2021
@zero2webmaster
Copy link

Constrain image proportions is absolutely critical. Please add this functionality ASAP.

@mtias
Copy link
Member

mtias commented Aug 2, 2023

@richtabor I believe this should be done now

@richtabor
Copy link
Member

@richtabor I believe this should be done now

Yup, as part of the aspect ratio + height/width overhaul in #51545. I'll close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi Needs Dev Ready for, and needs developer efforts [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants