From a8c90de173121f7418094d153e013bde824041d4 Mon Sep 17 00:00:00 2001 From: JBustin Date: Tue, 10 Mar 2015 10:45:48 +0100 Subject: [PATCH] refactor(command): use wget to load image from http(s) --- index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 9b098a5..a557929 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,14 @@ var exec = require('child_process').exec */ module.exports = function(file, fn){ - var cmd = command('exiftool ?', file); + var cmd; + + // wget -qO - file | exiftool -fast - + if (/^(http|https):\/\//.test(file)) + cmd = command('wget -qO - ? | exiftool -fast -', file); + + else cmd = command('exiftool ?', file); + exec(cmd, function(err, str){ if (err) return fn(err);