Magento - 警告:除以零Gd2.php

时间:2016-05-15 02:49:20

标签: php magento

我的商店有问题,它在PHP文件中生成零错误,名为Gd2.php

  

警告:在第379行的/home/domain/public_html/lib/Varien/Image/Adapter/Gd2.php中除以零

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);
    }
}

1 个答案:

答案 0 :(得分:0)

也许您指定了错误的图像尺寸,但很可能源文件不是图像或图像没有重新格式化