PNGQuant在Laravel 5.4中返回状态127

问题描述

$instance = new pngquant();

$exit_code = $instance->setimage("/a-folder/image-original.png")
    ->setoutputimage("/a-folder/image-compressed.png")
    ->overwriteExistingFile()
    ->setQuality(50,80)
    ->execute();

// if exit code is equal to 0 then everything went right !
if(!$exit_code){
    echo "Image succesfully compressed";
}else{
    echo "Something went wrong (status code $exit_code)  with description: ". $instance->getErrorTable()[(string) $exit_code];
}  

这是返回值127,在pngquantgetErrorTable中不存在。所以我收到了类似的错误消息:

“未定义的偏移量:127”

参考https://docs.ourcodeworld.com/projects/php-pngquant/documentation/methods/all-methods

我非常感谢您在此问题上的帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)