【问题标题】:how to upload multiple images of different sizes in cloudinary [Node js]如何在 cloudinary [Node js] 中上传多个不同大小的图像
【发布时间】:2021-10-21 10:29:48
【问题描述】:

例如,我希望上传一张不同尺寸的图片。 image_1 是 1080x1080,我想把它上传到 Cloudinary 三个不同的尺寸,比如 200x200、500x500 和原始的 1080x1080。

最后想得到三个不同大小图片的不同链接。

我查看了文档,但没有找到与我的用例相似的任何内容

  await cloudinary.uploader.upload(
         imagePath, (err, result) => {
            if (err) {
              return res.status(400).json({
                error: "Failed to upload file",
              });
            }
            console.log(result)
          }
        );

我目前上传图片的代码。

【问题讨论】:

    标签: node.js cloudinary


    【解决方案1】:

    您可以使用 Cloudinary 的响应式解决方案。您可以构建包含您想要指定的任何图像宽度或高度的动态图像 URL。这意味着您不必预先创建图像,并且您的图像会根据需要动态调整大小。

    欲了解更多信息:https://cloudinary.com/documentation/responsive_images

    【讨论】:

      猜你喜欢
      • 2021-12-09
      • 1970-01-01
      • 2015-05-02
      • 1970-01-01
      • 2020-09-26
      • 2016-01-13
      • 2020-04-07
      • 2021-02-03
      • 2020-07-13
      相关资源
      最近更新 更多