0

I have a problem in my store, and it's generating a division by zero error in the PHP file called Gd2.php

Warning: Division by zero in /home/domain/public_html/lib/Varien/Image/Adapter/Gd2.php on line 379

if ($this->_keepAspectRatio) {
    // do not make picture bigger, than it is, if required
    if ($this->_constrainOnly) {
        if (($frameWidth >= $this->_imageSrcWidth) && ($frameHeight >= $this->_imageSrcHeight)) {
            $dstWidth  = $this->_imageSrcWidth;
            $dstHeight = $this->_imageSrcHeight;
        }
    }
    // keep aspect ratio
    if ($this->_imageSrcWidth / $this->_imageSrcHeight >= $frameWidth / $frameHeight) {// <- Line 379
        $dstHeight = round(($dstWidth / $this->_imageSrcWidth) * $this->_imageSrcHeight);
    } else {
        $dstWidth = round(($dstHeight / $this->_imageSrcHeight) * $this->_imageSrcWidth);
    }
}
Pang
  • 9,564
  • 146
  • 81
  • 122

1 Answers1

0

Maybe you specified wrong image size but most likely source file is not image or image have not recornized format

Alexey Stepanov
  • 198
  • 2
  • 7