Needs review
Project:
WebP fallback image
Version:
1.2.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Nov 2025 at 15:12 UTC
Updated:
26 Feb 2026 at 12:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
adinancenci commentedComment #3
caesius commentedOur client site's watchdog logs were getting flooded with
'Unable to generate the derived image'messages from crawlers hitting white screens with'Error generating image.'It turns out this bug not only happens when trying to access an image derivative with .webp.jpg at the end, but any doubled up image extension ending in .jpg will trigger it: .png.jpg, .gif.jpg, .jpg.jpgThis behavior, along with the fact that this module cops Drupal core error messages verbatim and identifies them as coming from the Drupal core
imagemodule, obfuscates the fact that it's the unfortunately-namedwpfmodule generating the errors (imagine if more contributed modules identified themselves by acronyms...)This patch fixes the watchdog logs flooding, but I would propose also updating the controller to properly identify where the error is coming from.
https://git.drupalcode.org/project/wpf/-/blob/1.2.x/src/Controller/Image...
$this->loggerto identify the generating module aswpfnotimageComment #6
eduardo morales albertiWe encountered this same issue in a project using ImageMagick + file_mdm as the image toolkit. In our case, the missing source check doesn't just produce misleading log entries, it causes an unhandled exception from the file_mdm module.
>When the source image doesn't exist and WPF's deliver() method calls createDerivative(), the following chain triggers:
With ImageMagick, parseFile() delegates to file_mdm to read metadata:
Which calls FileMetadataPluginBase::loadMetadataFromFile() method:
Fix:
Drupal core's \Drupal\image\Controller\ImageStyleDownloadController::deliver() prevents this by checking source existence before calling createDerivative() method:
Since sourceImageExists() is private in the parent and WPF doesn't have $token_is_valid or $sample_image_uri computed, we applied a simplified version following the same pattern, returning a 404 Response with a notice log.
We also addressed the suggestions from #3 by:
'wpf'instead of inheriting'image'from the parent.Comment #7
eduardo morales albertiReady to review
Comment #8
eduardo morales albertiWe will opt to remove the module, as it is not necessary with modern browsers.