Undefined width/height for responsive images when using stage_file_proxy

Created on 31 December 2024, 4 months ago

When using Stage File Proxy, the image width and height attributes are not available. This causes fatal errors when using the Responsive Image field formatter from Acquia DAM.

There are several potential solutions that are being worked on for this:
* Stage File Proxy is working on a major overhaul to implement a stream wrapper that could resolve this ( https://www.drupal.org/project/stage_file_proxy/issues/2922292 and https://www.drupal.org/project/stage_file_proxy/issues/2928564 Add stage_file_proxy stream wrapper Needs work )
* There is a Core patch to suppress the error in responsive images, but this just sends the error to the log and still causes downstream issues when the width/height is needed ( https://www.drupal.org/node/2827921 )

As a temporary workaround, just using a dummy width/height when the image attributes are not available fixes the problem.

This is not an ideal solution, but a patch is provided here for sites that might need it. This is for the 1.0.x branch and might need a reroll for the 1.1 branch. But the 1.1 branch had some additional errors that might also be related to stage_file_proxy that I didn't have time to track down, so we are staying at the 1.0 version for now.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇺🇸United States mpotter

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024