-
Notifications
You must be signed in to change notification settings - Fork 8
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
Allow to enter manually numbers in the with/height sliders in the cloud library #620
Comments
Good point, we will review it. Thanks for sharing this with us. cc: @Codeinwp/design-team |
Thank you for your feedback, @Nazrinn What we can do is either find a middle ground, having both the Sliders and the Manual input: or remove entirely the Sliders, and use only Manual inputs for the Size: Let me know your thoughts, and which one you think will work the best. cc. @JohnPixle |
First one sounds best to me. I like using sliders as have an idea of how much smaller I am making the image. Also you know what would be great? |
const image = document.getElementById('myImage')
const width = image.width
const height = image.height
const aspectRatio = width / height
onWidthInputChange(newWidth) {
image.width = newWidth
image.height = newWidth / aspectRatio
}
onHeightChange(newHeight) {
image.width = newHeight;
image.height = newHeight * aspectRatio
} Some dummy JS logic to update an image width/heigh based on aspect ratio. |
Hey there, Great insights; thank you all for your contributions. I wanted to bring one aspect into the discussion, the fact that we have the Resize dropdown, which should accommodate the preserve ratio behavior. I.e when Fit is selected, the system resizes the image while keeping the aspect ratio to fit a given size. I think what we can do more is allow those input numbers, but adjust the sliders when the values are changed based on the Resize behavior. What do you think? |
This sounds good. I assumed that the Resize option does what you mentioned, Marius. Also, I am thinking if with this resize we understand we same thing as other products do. For example in Cloudinary, Imagkit and others - the idea with this is to Crop and image (of course having the option to adjust the image to be Fill or Fit). But in our case this is more like a changing the image size, not actually cropping it. |
Also just saying that I agree with @mghenciu demo's with the checkbox saying "Maintain Aspect Ratio". This is similar to how you can resize images in Photoshop so I can imagine this would feel familiar for at least some users. I'm not sure if fit/fill are very clear to most users. As I understand one is for maintaining the aspect ratio (resizing) and the other doesn't (cropping; from the sides toward the middle)? |
Indeed.
I agree, however, I think this will duplicate the functionality of the resize dropdown; maybe replacing the texts in the resize dropdown to make them easier to understand will solve the problem.
Yes, based on your description it might be a bug here. |
I suggest for now we stick to adding the Input fields, where user can add the numbers. Later we can review this more, also think about integrating a Image Crop feature. I'll create an issue for the mentioned bug, Marius. |
I'll mark this as Ready for Dev. |
What problem does this address?
I find it pretty frustrating to use the slider in the cloud image browser and try to obtain an exact width or height size for an image.
What is your proposed solution?
Allow a number input field to adjust the size slider values.
Will this feature require documentation? (Optional)
No.
Figma
The text was updated successfully, but these errors were encountered: