`ParametrizedImageStyle`: Generate srcset for local unmanaged files

Created on 31 July 2025, 9 days ago

Overview

We can currently generate a srcset value for images passed to the image SDC component for:

  • Images that are uploaded to an implementing SDC as a file entity
  • Stream wrapper paths

Generate srcset for local images on the filesystem that aren't a managed file e.g. modules/contrib/experience_builder/tests/modules/xb_test_sdc/components/image-gallery/gracie.jpg

\Drupal\image\Controller\ImageStyleDownloadController::deliver() does not currently support "shipped files" (aka files shipped as part of a module or theme), even though the logic in \Drupal\image\Entity\ImageStyle::buildUri() suggests it does (surfaced at https://www.drupal.org/project/experience_builder/issues/3535453#comment... 📌 Create an Image SDC that can be included by other SDCs Active ).

Proposed resolution

Either:

  • use the same route + subclass \Drupal\image\Controller\ImageStyleDownloadController::deliver() to add support for this, or better yet, add support in Drupal core for this.
  • introduce a new route
  • … something else?

See also https://www.drupal.org/project/experience_builder/issues/3538858 📌 Generate srcset for remote images from allowed 3rd parties Active which is doing the same but for 3rd party images

📌 Task
Status

Active

Version

1.0

Component

Component sources

Created by

🇬🇧United Kingdom justafish London, UK

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

Comments & Activities

Production build 0.71.5 2024