是否有可以使用NodeJS将缓冲区数据压缩到较小尺寸的方法?

发布于 2025-01-24 17:58:00 字数 145 浏览 3 评论 0原文

我正在研究Lambda功能,该功能从Google驱动器中获取图像并将其上传到S3存储桶。

我与之合作的数据格式是一个缓冲区,当我将其上传到S3桶时,大小为2.8MB。但是,我需要将其压缩为2MB。我似乎找不到可以处理该服务器端的合适库。

有建议吗?

I'm working on a Lambda function which fetches images from a Google drive and uploads it to S3 bucket.

The format of the data I'm working with is a Buffer and when I upload it to S3 bucket the size is 2.8mb. However I need to compress it to be under 2mb. I can't seem to find a suitable library which can handle this server side.

Any advice?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

仅此而已 2025-01-31 17:58:00

为了压缩图像并存储它,您可以使用jimp,它是一个图像处理库,并提供所需的所有设施。

作为参考,您可以转到此 documentation

For compressing images and storing it, you may use Jimp which is an image processing library and provides all the facilities you're looking for.

For reference, you may go to this documentation

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文