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

Set image size in percentages #4301

Closed
wants to merge 5 commits into from
Closed

Conversation

ellatrix
Copy link
Member

@ellatrix ellatrix commented Jan 4, 2018

Description

This PR attempts to fix the issue where the width of the editor is different from the front-end, in which case the image might be a lot bigger or smaller than expected. This is especially an issue on small screen devices.

How Has This Been Tested?

Resize an image and verify that the size is set as a percentage of the content width.

@ellatrix ellatrix added the [Feature] Media Anything that impacts the experience of managing media label Jan 4, 2018
@ellatrix ellatrix force-pushed the try/image-size-percentage branch from 20297e8 to 89d67d3 Compare January 4, 2018 21:36
@youknowriad
Copy link
Contributor

My initial reaction is that the image should be the size I set when I resize it, if we use percentage, it depends on the theme :). I guess that's the whole point of your PR but I think the current behavior is the right one :). The theme could provide editor styles to match its width?

I'll defer to others though, I'd be fine with both.

Noting that this breaks old images and we might want to provide a "deprecated" version if we want this in.

@ellatrix
Copy link
Member Author

ellatrix commented Jan 5, 2018

I can understand both. Maybe in some cases you need to have it exactly set in pixels, though it could be argued that you could make the image exactly that size with image editing tools. In other cases, I don't feel like setting the size in pixels makes the content very portable across themes and other places where the content is displayed.

@ellatrix
Copy link
Member Author

ellatrix commented Jan 5, 2018

Noting that this breaks old images and we might want to provide a "deprecated" version if we want this in.

@youknowriad Is there any recommended way to do this? I guess we might want to document this too for block authors.

@youknowriad
Copy link
Contributor

@iseulde yes, see the "deprecated" property in the quote block for example. Basically, you just put the old save, attributes and support there. It's not finalized yet #3673 but yes we'll have to document this.

@ellatrix ellatrix force-pushed the try/image-size-percentage branch from 383753e to 57dd2d6 Compare January 5, 2018 13:36
@ellatrix ellatrix force-pushed the try/image-size-percentage branch from 3fece81 to 343b182 Compare January 5, 2018 15:33
@ellatrix
Copy link
Member Author

ellatrix commented Feb 1, 2018

Closing this one again for now. May still be interesting, but the main image size issue was fixed.

@ellatrix ellatrix closed this Feb 1, 2018
@ellatrix ellatrix deleted the try/image-size-percentage branch February 1, 2018 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Media Anything that impacts the experience of managing media
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants