请求Pixellena Lux API时出现未处理的PromiseRejectionWarning



我在尝试使用Pixellena Lux API将jpeg图像转换为webp时出现以下错误。

(node:13962) UnhandledPromiseRejectionWarning: #<RequestIssueException>
(Use `node --trace-warnings ...` to show where the warning was created)
(node:13962) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:13962) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

API文件。

https://pixellena.com/docs/sdk/

我刚刚将以下部分更新为

let adjustments = {
"shifter": {
"steps": [
{
"scale-to": {
"width": 10
}
}
]
},
"encoder": {
"quality-measure": "fsim-c",
"qual-threshold": 2.0
}
}

出现此错误是因为"qual阈值";必须介于0.25和1.0之间。

有一些关于qual阈值的文档https://demo.pixellena.com/adjustments和https://pixellena.com/docs/lux-api/您可以查看。

相关内容

最新更新