how to load an image from url into buffer in nodejs

前端 未结 5 952
谎友^
谎友^ 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:17

    Use the request library.

    request('', function(err, response, buffer) {
        // Do something
    });
    

    Also, node-image-headers might be of interest to you. It sounds like it takes a stream, so it might not even have to download the full image from S3 in order to process the headers.

    Updated with correct callback signature.

提交回复
热议问题