gpt4 book ai didi

node.js - 请求 Pixellena Lux API 时未处理的PromiseRejectionWarning

转载 作者:行者123 更新时间:2023-12-04 08:26:01 25 4
gpt4 key购买 nike

尝试使用 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-threshold”的值必须介于 0.25 和 1.0 之间。
https://demo.pixellena.com/adjustments 上有一些关于 qual-threshhold 的文档。 , 和 https://pixellena.com/docs/lux-api/你可以检查。

关于node.js - 请求 Pixellena Lux API 时未处理的PromiseRejectionWarning,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65257566/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com