Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
35
rated 0 times [  41] [ 6]  / answers: 1 / hits: 90097  / 11 Years ago, fri, august 16, 2013, 12:00:00

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 parameter and grab the image from it.



I am u using the ExifImage project below to get the exif info and according to their documentation:



Instead of providing a filename of an image in your filesystem you can also pass a Buffer to ExifImage.



How can I load an image to the buffer in node from a url so I can pass it to the ExifImage function



ExifImage Project:
https://github.com/gomfunkel/node-exif



Thanks for your help!


More From » node.js

 Answers
24

Try setting up request like this:



var request = require('request').defaults({ encoding: null });
request.get(s3Url, function (err, res, body) {
//process exif here
});


Setting encoding to null will cause request to output a buffer instead of a string.


[#76321] Thursday, August 15, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jaydon

Total Points: 651
Total Questions: 103
Total Answers: 100

Location: Norway
Member since Mon, May 23, 2022
2 Years ago
;