Image formatter to expose image width and height

Created on 3 June 2025, 3 days ago

Motivation

When formatting an image, the url image style formatter is great. However, it would good to include image width and height as well.

Proposed resolution

Add a dedicated formatter.

Feature request
Status

Active

Version

3.0

Component

Code

Created by

🇦🇹Austria fago Vienna

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

Merge Requests

Comments & Activities

  • Issue created by @fago
  • Merge request !124Resolve #3528071 "Image formatter to" → (Merged) created by fago
  • 🇦🇹Austria fago Vienna

    ok, implemented this.

    The MR now:
    * Exposes the image formatter with a proper label, so it is easily discovered. I had missed that "file properties" is handling images!
    * Works over the existing formatter to improve it.
    * It now adds width/height correctly from the image style. Tested and verified to work with focal-scale and normal scaling correctly.
    * It makes flattening optional
    * It now also implements adding it as slot (even though this does not make sense always, it now works as configured)
    * it optionally removes flattening-prefix, since the prefix is not needed when the image is within a media entity. so there can be a nice output easily then
    * adds test coverage for everything, co-authored by copilot. Code is not 100% nice all the time, but it tests things correctly!

  • 🇸🇮Slovenia useernamee Ljubljana
  • Pipeline finished with Skipped
    2 days ago
    #514341
    • fago committed 48c54eae on 3.x
      Issue #3528071 by fago: Improve image formatter and expose image width...
  • 🇦🇹Austria fago Vienna

    Thank you, merged then!

Production build 0.71.5 2024