Skip to content

Commit

Permalink
Seems like the canvas module used doesn't support GIF files on a stoc…
Browse files Browse the repository at this point in the history
…k Ubuntu 16.04. Avoid using it with GIF files for now.
  • Loading branch information
papandreou committed Jul 19, 2016
1 parent 2f7c288 commit 1929d39
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/processImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ describe('express-processimage', function () {
response: value
}
);
})
.addAssertion('<Buffer> [when] converted to PNG <assertion>', function (expect, subject) {
expect.errorMode = 'bubble';
return sharp(subject).png().toBuffer().then(function (pngBuffer) {
return expect.shift(pngBuffer);
});
});

it('should not mess with request for non-image file', function () {
Expand Down Expand Up @@ -739,7 +745,7 @@ describe('express-processimage', function () {
height: 48
}
})
.and('to resemble', pathModule.resolve(__dirname, '..', 'testdata', 'rotatedBulb.gif'))
.and('when converted to PNG to resemble', pathModule.resolve(__dirname, '..', 'testdata', 'rotatedBulb.png'))
});
});

Expand All @@ -756,7 +762,7 @@ describe('express-processimage', function () {
},
Interlace: 'Line'
})
.and('to resemble', pathModule.resolve(__dirname, '..', 'testdata', 'rotatedBulb.gif'))
.and('when converted to PNG to resemble', pathModule.resolve(__dirname, '..', 'testdata', 'rotatedBulb.png'))
});
});
});
Expand Down
Binary file added testdata/rotatedBulb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1929d39

Please sign in to comment.