diff --git a/lib/index.js b/lib/index.js index 9060571..67c2756 100644 --- a/lib/index.js +++ b/lib/index.js @@ -366,8 +366,12 @@ class Instagram { let file - // Needed to new method, if image is from url. - if (isUrl(photo)) { + // Needed to new method, + // if image is from buffer, + if (Buffer.isBuffer(photo)) { + file = photo + } else if (isUrl(photo)) { + // if image is from url. // Enconding: null is required, only this way a Buffer is returned file = await request.get({ url: photo, encoding: null }) } else {