Search code examples
drupal

Drupal image styles DivisionByZeroError


I have a fresh Drupal 10 installation and I am trying to create a new image style, whenever I edit an image style (new or a default Drupal one) I get this error:

DivisionByZeroError: Division by zero in template_preprocess_image_style_preview() (line 77 of core/modules/image/image.admin.inc).

Adding some logging to core/modules/image/image.admin.inc reveals there is no "derivative" key on $variables['preview'].

I am using PHP8.2 and NGINX on Ubuntu 22 Windows Subsystem for Linux.


Solution

  • I have stopped using WSL as it seemed to be the cause of the issue, it works without any problems using WAMP or NGINX on an Ubuntu VM.