how to load an image from url into buffer in nodejs

前端 未结 5 933
谎友^
谎友^ 2020-12-29 19:31

I am new to nodejs and am trying to set up a server where i get the exif information from an image. My images are on S3 so I want to be able to just pass in the s3 url as a

5条回答
  •  隐瞒了意图╮
    2020-12-29 20:22

    Use the axios:

    const response = await axios.get(url,  { responseType: 'arraybuffer' })
    const buffer = Buffer.from(response.data, "utf-8")
    

提交回复
热议问题