Needs to work with core Responsive Image module

Created on 16 January 2025, 6 days ago

Problem/Motivation

Only displays one Bunny Optimizer image style source when used with core's Responsive Image module

Steps to reproduce

  1. Enable Responsive Image module
  2. Create 2 or more Bunny Optimizer image styles
  3. Create a responsive image style containing 2 or more Bunny Optimizer image styles
  4. Apply that responsive image style to an image on an entity type
  5. View an entity of that type
  6. Inspect the markup - only 1 Bunny Optimizer image style source is present

Proposed resolution

Responsive Image module distinguishes between image styles by obtaining the dimensions from the Image Effect (see Drupal\image\ImageEffectInterface::transformDimensions()). Ideally a transformDimensions() function needs to be added to BunnyOptimizerClassImageEffect, but it's unclear how this functiton would work.

Remaining tasks

Find a method of obtaining the resulting image dimensions after the Bunny Image Class has been applied.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom jofitz

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

Comments & Activities

  • Issue created by @jofitz
  • 🇧🇪Belgium dieterholvoet Brussels

    I think the only way to detect what dimension transformations happen in a Bunny Optimizer image class is to talk to the API and figure out what the underlying operations are, but that sounds complex. We'll would also need to add a configuration option to the toolkit for the API key. If you're willing to implement this I'd be happy to review and merge it, but since I don't use the Responsive Image module myself I don't see myself implementing this anytime soon.

  • 🇧🇪Belgium dieterholvoet Brussels

    If you or your organisation really needs this feature: I'm also available for paid work. Feel free to contact me through the contact form on my profile if you're interested in sponsoring my time to work on this.

Production build 0.71.5 2024