Problem/Motivation
I'm trying this module for the first time but no images are getting rendered and there is a 404 for each image style. Using the breakpoint debugger I can see that in onKernelRequest in the section that explodes the $path into $style_parts the $width and $height aren't pointing to the correct $style_parts.
This is because it fails to take into account the image style name is drimage_improved which explodes into two parts drimage and improved. So when it looks for $width at $style_parts[1] it is finding improved and not the actual width.
I'm confused how this is working at all for people?

Steps to reproduce
Use the module normally and add a breakpoint on line 113 of DrimageSubscriber.php
Notice the $style_parts in the debugger as you step through. Also note how the wrong values are added for the $width and $height.
Proposed resolution
Increment the array index to take into account the extra array item.
Remaining tasks
- ✅ File an issue
- ➖ Addition/Change/Update/Fix
- ➖ Testing to ensure no regression
- ➖ Automated unit testing coverage
- ➖ Automated functional testing coverage
- ➖ UX/UI designer responsibilities
- ➖ Readability
- ➖ Accessibility
- ➖ Performance
- ➖ Security
- ➖ Documentation
- ➖ Code review by maintainers
- ➖ Full testing and approval
- ➖ Credit contributors
- ➖ Review with the product owner
- ➖ Release notes snippet
- ❌ Release
API changes
- N/A
Data model changes
- N/A
Release notes snippet
- N/A
| Comment | File | Size | Author |
|---|
Issue fork drimage_improved-3540772
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
tancA solution could be to remove that part of the array, like:
Comment #3
rajab natshahThanks, Tancredi, for reporting and the Proposed fix
Let us create an MR to quick test then follow up with a quick fix release
Comment #4
tancI should probably note that this is a Drupal 11 site, in case that makes a difference
Comment #6
rajab natshahTancredi, thanks for the MR
For sure, to be tested in both Drupal 10 and Drupal 11
Comment #7
josebc commented