Use jimp instead of lwip for image processing

Jimp does not install on recent versions of NodeJS because of changes
in the bundled version of zlib. Jimp is a pure JS replacement.
This commit is contained in:
Paul Hooijenga
2018-01-16 20:17:34 -06:00
committed by Gaël Métais
parent a20c5677b4
commit 3fc0d9418f
4 changed files with 31 additions and 31 deletions
+6 -6
View File
@@ -228,14 +228,14 @@ describe('redownload', function() {
newEntry.weightCheck.bodySize.should.equal(4193);
newEntry.weightCheck.bodyBuffer.should.deep.equal(fileContent);
// Opening the image in lwip to check if the format is good
var lwip = require('lwip');
lwip.open(newEntry.weightCheck.bodyBuffer, 'png', function(err, image) {
image.width().should.equal(620);
image.height().should.equal(104);
// Opening the image in jimp to check if the format is good
var Jimp = require('jimp');
Jimp.read(newEntry.weightCheck.bodyBuffer, function(err, image) {
image.bitmap.width.should.equal(620);
image.bitmap.height.should.equal(104);
done(err);
});
})
.fail(function(err) {