gpt4 book ai didi

javascript - nodejs - 检查图像是否为空白

转载 作者:行者123 更新时间:2023-11-29 21:42:01 29 4
gpt4 key购买 nike

我正在创建一个测试应用程序,它为用户输入的 url 输出图像。截图是用phantomjs + nightmarejs截取的。

有时用户输入不存在的 url,因此图像屏幕截图为空白。nodejs 中是否有任何库允许我检查图像是否为空白?或者更好的方法?

谢谢!

最佳答案

Sometimes user enters nonexistent url so image screenshot is blank. Is there any lib in nodejs that allows me to check if image is blank? or maybe a better approach?

是的,有更好的方法。在截屏之前检查 URL 是否给你 404 错误,如果是,则将错误返回给用户。

关于javascript - nodejs - 检查图像是否为空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32457737/

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