Selected widths larger than largest available size (CKE Media Resize Extra Large) should fall back to the largest size rather than Default width

Created on 18 December 2023, 6 months ago
Updated 25 January 2024, 5 months ago

Problem/Motivation

When a user drags the resize handles to a width larger than the greatest available view mode (CKE Media Resize Extra Large in standard cases, or 1200px) the image is rendered using the Default view mode width (480px). It feels like anything wider than the largest size should fall back instead to the closest value, not the default).

Steps to reproduce

1. Add a media library image to a content area.
2. Set the size using the resize drag handles to a value larger than the largest available mode (in this example 1300px width).
3. Save the node.
4. Note that when viewing the node the rendered width is the Default width (in my case 480px), not the chosen width (1300px) or the largest available width (1200px)

Proposed resolution

Either constrain the width setting to the largest available width or let rendering fall back to that largest width.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

1.0

Component

User interface

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @codebaboon
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    I think this should work with the image styles - you pick a style to use, then you can resize it to fit.

  • Thank you for the response, Damien. I'm not quite clear on what you mean by "pick a style to use, then you resize it to fit", where can the user pick a style from?

    In looking at this from a user perspective, as far as I can tell the user is presented with an interface where they select the image and are given drag handles to resize to seemingly 'infinite' size. If they expand the dimensions beyond the max style width, which is not something displayed to them, the image editor shows the image expanding as expected, however upon saving the rendered page ends up adjusting the size to the "default" style width. They then either assume the resize did not work at all or they need to play a bit of a guessing game saving in smaller sizes until they find one that is below the unknown-to-them max.

    I'm not sure on the technical difficulties in doing so, but in my head in an ideal world the largest available style would be rendered.

    I suppose a workaround might be for us to set the Default style to our widest one, but that feels like it will more often than not be an inappropriate default selection.

  • When resizing images in the content area, it seems the fallback to the default width (480px) instead of the chosen or the largest available width is a glitch; proposing a fix to either constrain the width to the largest available or allow rendering to fall back to that width would enhance the user experience in this "game" of image manipulation.

  • πŸ‡±πŸ‡»Latvia biguzis

    Related issue: https://www.drupal.org/project/ckeditor_media_resize/issues/3407078 πŸ› Center aligment isn't working good Active

Production build 0.69.0 2024