- Status changed to Needs review
almost 2 years ago 2:34pm 19 January 2023 - ๐ฎ๐ณIndia munish.kumar
The above patch does not seems to be apply. @Siddhraj you have made changes in the core file. This issue should be fixed within this module itself.
- Status changed to Needs work
almost 2 years ago 5:46am 27 February 2023 - ๐ต๐ญPhilippines josiahcavitana
Hello, folks.
I'm using Drupal 9.5.10 and stumbled upon the same error.
"DivisionByZeroError: Division by zero in docroot/core/modules/image/image.admin.inc on line 72 #0 [internal function]: template_preprocess_image_style_preview(Array, 'image_style_pre...', Array)"I'm always seeing solutions about permissions. How do I set the right permissions for it to work? Thank you.
- ๐ฎ๐นItaly sjpagan
Hi,
in my case had a wrong configuration on Dockerfile, I solved it like this:FROM php:8.1.6-apache RUN apt-get update && apt-get install -y \ libwebp-dev \ libpng-dev \ libjpeg-dev \ && docker-php-ext-install -j$(nproc) gd \ && docker-php-ext-configure gd --with-freetype --with-webp --with-jpeg \ && docker-php-ext-install gd
The problem is due to a wrong configuration of GD on the server and not to the code.
- ๐ฎ๐นItaly mondrake ๐ฎ๐น
The failure occurs in Drupal core, not in the module. The moduleโs image toolkit under some circumstances may not be able ti generate the output image, but even if that happens, the failure should be logged, and not cause WSOD.
Also, patch in #6 is for Drupal core.
Moving the issue to Drupal coreโs queue.
- Merge request !6025Fix DivisionByZeroError: Division by zero in template_preprocess_image_style_preview() โ (Open) created by mondrake
- Status changed to Needs review
12 months ago 4:17pm 4 January 2024 - Status changed to Needs work
12 months ago 8:43pm 4 January 2024 - ๐บ๐ธUnited States smustgrave
Can we get a failing test as a next step.
- ๐ง๐ชBelgium fernly
This can be caused by misconfigured imagemagick executable path, see /admin/config/media/image-toolkit.
- ๐บ๐ธUnited States mark_fullmer Tucson
I can confirm that the answer in #11 worked for me -- it was resolvable by configuring the GD toolkit "correctly".
- ๐ช๐ธSpain manuel garcia
Also ran into this today - in my case setting proper permissions on the files folder did the trick as well, so thank you @zigazou for sharing.