-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 Image Size dropdown for Media & Text block #24795
Add Image Size dropdown for Media & Text block #24795
Conversation
@ockham Thanks for the feedback! Replaced them with shorthand. |
I'm not sure this is behaving as I'd expect. It looks like the "Thumbnail, Medium, Large, Full" dropdown only modifies the media resolution, and not the media dimensions (Ex. Width / Height). I'm still wrapping my head around the block editor user experience and all of its quirks, so someone else may have more insight. Maybe @ockham ? 🙂
|
@jeyip Actually, that's the correct behaviour here. The dimensions of the media is controlled by the Media & Text Block. Might seem strange but the image always fits it's cell so the Image Size won't affect the dimensions. |
I see why, from a technical perspective, the dimensions don't change. I, however, as a WordPress user, would expect the image to resize appropriately. The reason I think this is because if the images don't resize, the only feature this introduces is the ability to display a set of more or less pixelated images. Although there might be a use case, I don't think this captures the intention of the original issue. @nosolosw or @deskoj would either of you be able to speak more about your expectations? |
I think this has lots of value, but I agree that "image size" sets the wrong expectation. |
I'm not sure what would be the best approach to present this to the user. It's more like manual image optimization since the block itself can't decide which size of the image should be used.
|
I think renaming it image quality makes a lot of sense too 👍 I'm still curious about the value proposition, and I think I might be missing something. @david-szabo97 or @Copons would you mind elaborating a little bit about the use case for image quality? (Thank you ahead of time for the patience 🙏 ) Is it to improve frontend loading speed? The code looks good, so this has my +1 when we resolve this conversation. |
Yeah, pretty much. It's also good to have the same options for similar features. |
Thanks for the explanation. Much appreciated :) |
+1, what do you think about merging this and I'll follow-up with a PR for the rename? The label is hardcoded, so I'd make it configurable via prop in a separate PR.
|
This keeps the fixtures clean and doesn't add an extra mediaSizeSlug attribute to every block.
953b275
to
ca8594f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure @david-szabo97 sounds good to me! ✨
Closes: #24688
Description
Add an Image Size dropdown for Media & Text block. We can change the size of the image for the Image block, but we didn't have the option to do the same for Media & Text block. Which caused the Media & Text block to always render the full-size image.
NOTE: Default value for Image Size is Full. I think Large would be better in general, but that would break existing posts.
How has this been tested?
Screenshots
Types of changes
New feature (non-breaking change which adds functionality)
Checklist: