PHP图片库无法使用Capital JPG扩展

时间:2016-05-24 06:02:09

标签: php jpeg thumbnails

PHP图像库不使用Capital JPG扩展,它显示错误 - '致命错误:允许的内存大小为67108864字节耗尽(试图分配23040字节)' - 但其他所有图像都正常工作。我正在使用Uber画廊

我认为这部分代码会影响..

 $newImage = imagecreatetruecolor($thumbWidth, $thumbHeight);

    // Create new thumbnail
    if ($imgInfo[2] == IMAGETYPE_JPEG) {
        $image = imagecreatefromjpeg($source);
        imagecopyresampled($newImage, $image, 0, 0, $x, $y, $thumbWidth, $thumbHeight, $width, $height);
        imagejpeg($newImage, $destination, $quality);
    } elseif ($imgInfo[2] == IMAGETYPE_GIF) {
        $image = imagecreatefromgif($source);
        imagecopyresampled($newImage, $image, 0, 0, $x, $y, $thumbWidth, $thumbHeight, $width, $height);
        imagegif($newImage, $destination);
    } elseif ($imgInfo[2] == IMAGETYPE_PNG) {
        $image = imagecreatefrompng($source);
        imagecopyresampled($newImage, $image, 0, 0, $x, $y, $thumbWidth, $thumbHeight, $width, $height);
        imagepng($newImage, $destination);
    }

    // Return relative path to thumbnail
    $relativePath = $this->_rThumbsDir . '/' . $fileName;
    return $relativePath;
}

如何解决此问题。

0 个答案:

没有答案