Skip to content

Media & Text block "Crop image to fill" should also work the other way around #73809

@lecklin

Description

@lecklin

Introduction

Labelled as enhancement, but possibly a bug depending on the block's original intention. More on that below.

Before the just released WP 6.9 the Media & Text block "Crop image to fill" worked the other way around as well.
In other words if an image was larger than the text content area, the image was still cropped resulting in the Media & Text block height being limited to the size (height) of the text content area.
The change in the block styling from WP 6.8.3 to WP 6.9 was this, which as far as I can tell was addressing a separate issue: a4a5b07

I'd say in almost all client cases of mine the toggle is used because an image much taller than the text is added to the block and the toggle allows to not have to actually crop the image to make a sensible height element. Rarely if ever are images chosen for the element too small.
I actually thought this was how it was supposed to work and was already creating an issue with the bug label. How it used to work even "feels right" , as you can choose the focal point etc.
However after I saw the text describing the option I realize it was maybe meant to just compensate for images smaller than required.

If your image does not fit the entire column width, you can turn on this option to automatically crop the image so that it fills the entire column.

Perhaps at some point the intention changed to what I expected, considering that quote above from here even has a different label for the toggle. "Crop image to fill" as it is now sounds more like what I'm expecting (and what was seen in WP 6.8.3 and earlier), vs "Crop image to fill entire column" which is more like what is happening now.
In the previous version, you can still have the entire image show like it does now by turning off the toggle. Now the toggle simply doesn't do anything if the image is taller than the content area.

Maybe this actually is a bug, but I'm no longer sure since the toggle does have an effect if the image isn't large enough to fill the space.
This isn't a bug report, but the screenshots below are with WP 6.8.3/6.9, no plugins at all and the latest Twenty Twenty-Five theme. It's the same with the latest separate Gutenberg plugin as well.

What problem does this address?

Having the "Crop image to fill" crop even when an image is large enough allows the block text content to change over time, without having to possibly choose another image or upload the same image again with a new actual crop.
It's also a simpler editing flow, since even for short media text blocks you can choose any image without having to crop the image file itself.
With how it now works in WP 6.9, to achieve what's seen in the WP 6.8.3 screenhot below requires you to actually crop the image.
If you do need to show the entire image, then just don't enable the toggle.

What is your proposed solution?

Bring back the styling from 6.8.3 for the "Crop image to fill" setting, requiring of course another solution to #68610

Screenshots

Crop image to fill -setting:

Image

Crop image to fill in WP 6.8.3:

Image

Crop image to fill in WP 6.9:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] Media & TextAffects the Media & Text Block[Type] BugAn existing feature does not function as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions