Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It happens sometimes when uploading the images.
See the screenshot.
The code:
function imageapi_image_scale(&$image, $width = NULL, $height = NULL, $upscale = FALSE) {
$aspect = $image->info['height'] / $image->info['width'];
Comment | File | Size | Author |
---|---|---|---|
Picture 19.png | 62.75 KB | kenorb |
Comments
Comment #1
dhnmya CreditAttribution: dhnmya commentedPlease Help me to fix this problem....It's urgent....Please......
Comment #2
tarto CreditAttribution: tarto commentedTry to install the php5-gd package on your server.
It worked for me.
Comment #3
vipin.mittal18GD is already installed on my system. I transferred my files from development to production environment.
Both the environment are same but somehow uploading image showing an error " warning: Division by zero in /web/thecabin.net/htdocs/sites/all/modules/contrib/imageapi/imageapi.module on line 221."
Please help me in this.
Thanks in advance
Comment #3.0
vipin.mittal18added code
Comment #4
Becker-and-Becker CreditAttribution: Becker-and-Becker commentedwe have the same issue and php-gd is installed on our server. Our server is on a shared hosting and so we do not have easy access to install libraries. Is there something else we can do to find out why this is happening, so that we may be able to fix it.
Comment #5
NancyDruSee also #1284010: imageapi_image_scale tries to divide by width regardless of what width is - causes php warning: division by zero
Comment #6
kenorb CreditAttribution: kenorb commented