无法确定远程图像的格式

Could not determine format of remote image

我正在尝试通过 phpthumb 库调整本地图像的大小,它为特定图像提供以下异常:

Exception Object
(
[message:protected] => Could not determine format of remote image: http://localhost/brandmenowcrm/upload/products/UC102 Yellow.jpg
[string:Exception:private] => 
[code:protected] => 0
[file:protected] => /var/www/html/brandmenowcrm/application/third_party/phpthumb/ThumbBase.inc.php
[line:protected] => 193
)

当我在浏览器中查看此图像时,它运行成功。

我建议你检查get_headers函数来验证文件的格式(例如:content_type)。

此外,如果您正在使用 http://localhost/brandmenowcrm/upload/products/UC102 Yellow.jpg,那么请尝试使用绝对文件路径而不是 URL。