From a9fdd82911fd6f2326649bf1e9867191ea0ffe89 Mon Sep 17 00:00:00 2001 From: reality Date: Wed, 21 Aug 2013 15:32:32 +0000 Subject: [PATCH] how about this --- modules/imgur/imgur.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/modules/imgur/imgur.js b/modules/imgur/imgur.js index a040849..fff0a80 100644 --- a/modules/imgur/imgur.js +++ b/modules/imgur/imgur.js @@ -79,12 +79,8 @@ var imgur = function(dbot) { '.' + ext[_.random(0, ext.length - 1)]; dbot.db.imgur.totalHttpRequests += 1; var image = request(testUrl, function(error, response, body) { - console.log(response.head); - console.log(response.headers); - // 492 is body.length of a removed image - gm(body).size(function(err, val) { - console.log(err); - console.log(val); + gm(new Buffer(body, 'binary')).size(function(e, val) { + // 492 is body.length of a removed image if(!error && response.statusCode == 200 && body.length != 492 && val && val.height > 300 && val.width > 300) { dbot.db.imgur.totalImages += 1;