Skip to content

Media Editor Modal: spec out a "scale" control #81413

Open

Description

@ramonjd

Media Editor Modal: spec out a "scale" control

Note

This is for gathering requirements and weighing options, not proposing a design. Nothing below is a recommendation.

Part of #80389. Follows on from #73771.

What we mean by "scale"

Resampling the whole image so the file we write has different pixel dimensions. Every pixel changes. Two neighbouring things already in the modal are not this:

  • Crop throws pixels away and changes framing. Dimensions change as a side effect; the surviving pixels are byte-for-byte the originals.
  • Zoom (the +/− in the crop panel) is also crop framing. It scales the image beneath a fixed stencil, changing which source region the crop covers. Output pixels always equal the source pixels of that region — nothing is resampled (image-editor/core/source-region.ts, media-editor-modal/build-modifiers.ts).

The Image block's width/height are presentation only.

Why we need one

  • Nothing in the pipeline can change output size.
  • The classic screen has one.
  • A cropped image no longer fills the space it had, and people use the cropper to fix that. After a crop the block keeps its layout slot but points at an attachment with fewer pixels, so the browser stretches it.
  • some phone cameras produce 4000–8000px images and there's way to get a 1200px file.

Options for the control

  1. Two linked pixel fields (classic parity). Exact, familiar, copy already translated. But two inputs for one degree of freedom, it invites "can I unlink them?" (no — that's distortion), and pixel counts mean little to most people.
  2. A single percentage or factor. One control, one concept, no ratio bookkeeping, same behaviour in portrait and landscape. But you can't type "exactly 1200px", and percentage of what — the original upload or the current crop? — is genuinely ambiguous once a crop is in the stack.

Assumptions/questions

  • Only scale down, not up. Scaling a cropped child up is lossy
  • Showing the cost. At fit-to-screen zoom a 50% scale looks identical. Without resulting dimensions, ideally file size, nobody understands what they did.
  • Copy. The classic panel needs a help toggle, a warning and a hint about doing things in the right order. If our control needs that much explaining, it's the wrong control.
Image

Not in scope

Unlinked width/height (distortion), format conversion and quality sliders, upscaling that invents detail, changes to how the Image block renders.

Related,

#78187 adds precise X/Y/width/height fields for the crop rectangle in source pixels

Done when

Activity

  1. added
    [Type] Enhancement
    [Feature] Media
    on Aug 11, 2026
  2. andrewserong commented on Aug 11, 2026

    @andrewserong
    Contributor

    Just throwing out a couple of other options for the controls (again not a recommendation, but in the spirit of sharing ideas):

    • Just as we have aspect ratio controls that hook into available aspect ratios in the current theme, could or should we have a drop-down selector so that folks can resize/scale to one of the site/theme's available image sizes (e.g. the defaults or ones a theme has added via add_image_size.
    • "Only scale down, not up. Scaling a cropped child up is lossy" while it is lossy/destructive a valid use case might be that someone wants to scale up pixel art or a very small image to be artistically blurred at a much larger size. I.e. your image is a 64x64 soft blob of color and you want it to natively be a nice big 2000px size as a background on a cover block.
      • If going down this path, folks might want options to select from nearest-neighbour or bilinear/bicubic interpolation, etc
      • That said, I agree with this not being in scope! Just thinking that while not in scope, it might be something to consider in terms of: might we want to add this somewhere in the future?
    • Again, not a recommendation, but arguably should someone be able to scale the image via drag handles just as they do a crop? If so, then scale might be a state change to the cropper rather than just being in put controls.

    Just thoughts, though! I don't feel very strongly about scaling/image resizing as a feature (I think cropping was the much more useful one), but I think there's some potentially interesting things to play with here.

  3. ramonjd commented on Aug 11, 2026

    @ramonjd
    MemberAuthor

    I don't feel very strongly about scaling/image resizing as a feature

    Thanks for recording your thoughts. You know, the more I look into it, the more I'm thinking that it's not the killer editor feature and can be demoted. 😄

    The current media library even quarantines the scale operation because the order matters:

    • do you crop then scale the cropped version
    • do you scale the original image, and then crop takes effect on that (preferred in my experiments so far)

    I guess that weirdness also explains the warning/help text in the screenshot above.

    Furthermore, you can already resize the image in the editor. It's not changing the source size, sure, but there's a way.

    could or should we have a drop-down selector so that folks can resize/scale to one of the site/theme's available image sizes (e.g. the defaults or ones a theme has added via add_image_size.

    This might be the better POC. Good one! I like that it can hook into the filter too.

    but arguably should someone be able to scale the image via drag handles just as they do a crop? If so, then scale might be a state change to the cropper rather than just being in put controls.

    If so, and if in the cropping canvas, then maybe it could be a separate operation like in the current media library, e.g., crop is disable while scaling, and vice versa. Not sure.

  4. ramonjd commented on Aug 11, 2026

    @ramonjd
    MemberAuthor

    I got a demo together anyway. I'll keep the branch so we can judge the blast radius and general usability.

    Kapture.2026-08-12.at.08.18.58.mp4
  5. andrewserong commented on Aug 12, 2026

    @andrewserong
    Contributor

    You know, the more I look into it, the more I'm thinking that it's not the killer editor feature and can be demoted. 😄

    Agree it's likely not a killer editor feature 😄

    From looking at your demo above, I'm nearly wondering if it'd make sense for scale / resize to be its own tab? That might help with creating a separate mode that doesn't clash with crop and would also mean consumers could opt-in or out of whether scale is available alongside cropping? Here's a couple of very quick mockups with Claude Design to get a sense of the idea. It only took a few minutes to whip these up, so we can just as quickly toss the idea out if it's overblown or not worth pursuing:

    A "Resize" tab idea

    This one is likely super overblown but it's visualising what might happen if we were to try to stuff full Photoshop or Affinity-like controls into this kind of UI:

    Resize tab (with resize Image) Resize tab (with resize Canvas)
    Image Image

    A "Scale" tab idea

    This is probably closer to a sweet spot, and it also paves a way to showing file-size or eventual quality controls one day (user configurable JPEG quality settings, etc):

    Image

    In any case, both the ideas above are much more than we should take on for 7.2 IMO as scaling is kinda tangential to cropping / continuing to polish editing, but just throwing these out there in case it sparks ideas!

  6. ramonjd commented on Aug 12, 2026

    @ramonjd
    MemberAuthor

    it also paves a way to showing file-size or eventual quality controls one day (user configurable JPEG quality settings, etc):

    The third option appeals to me more too, thanks for pulling them together! The block does tend to favour control overload, so reducing that by isolating scale from crop is a neat idea!

    We could rely on user intent: crop composes/manipulates while resize has no corresponding canvas gesture. In that genre we could pile on image format, output quality. Not sure about metadata, I think that could be part of the details tab redesign.

    It could also avoid the "scale" vs"zoom" controls confusion.

    The pipeline also needs to be reflected in the controls somehow. Core Media Library scales the original image as far as I can tell (hence the 100% gating). TBH the controls are really confusing there, but it tries to enforce the discipline of scale first, then crop. But I can see it getting confusing if users scale, then crop, then scale again. I suppose if it's all reflected on the canvas it's mitigated.

    One more thing: the block editor creates a new attachment, which makes sense as a cost for a crop. Is it the right operation for scale? If not, then I'd say scale could safely be a Media Library thing rather than a block editor one.

  7. andrewserong commented on Aug 12, 2026

    @andrewserong
    Contributor

    One more thing: the block editor creates a new attachment, which makes sense as a cost for a crop. Is it the right operation for scale?

    Speaking just for myself, if I were using scaling controls I'd expect it to apply to the main attachment image/object itself with an option to restore to original, rather than creating a new attachment. Basically that a scaled image would work similarly to image sub-sizes and then you'd find it selected as "Custom" or something like that under the Settings -> Resolution control in the block's settings. I.e. where we can currently select Large or whatever:

    Image

    If not, then I'd say scale could safely be a Media Library thing rather than a block editor one.

    Yeah, same. I think that's another reason I'm liking this extra tab idea, as it makes it quite simple to add/remove it depending on the context (i.e. don't show it as part of the Crop modal that users get to via the image block).

    As such I think my hunch is that this'll be a good one to work on as part of the goal of replacing the media editor in core / the media library, but probably not something we need to necessarily prioritise as part of the "media editor modal" as it pertains to editing images in the block editor? Or to put it differently: I really like the idea of a scaling tab (and quality controls, etc), but this feels like it could blow out into a mini-project of its own.

    In any case, thanks for digging into the ideas here! It's an interesting one.

  8. ramonjd commented on Aug 12, 2026

    @ramonjd
    MemberAuthor

    I'll keep the branch

    Pushed here for later:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Media[Type] Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions