Skip to content

Commit

Permalink
Tests rendering of partial frame against expected partial frame, fina…
Browse files Browse the repository at this point in the history
…lizing pull #18.
  • Loading branch information
jtlapp committed Jul 21, 2019
1 parent 1a9a0a9 commit 70ca28f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gifwrap",
"version": "0.7.6",
"version": "0.8",
"description": "A Jimp-compatible library for working with GIFs",
"main": "src/index.js",
"scripts": {
Expand Down
Binary file removed test/fixtures/rnaples-bad.png
Binary file not shown.
Binary file removed test/fixtures/rnaples-check.png
Binary file not shown.
Binary file modified test/fixtures/rnaples-frame-10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 13 additions & 14 deletions test/test_decoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,22 +203,21 @@ describe("multiframe decoding", () => {
describe("partial frame decoding", () => {

it("renders partial frames properly onto full frames", () => {
let actualBitmapImage;

return GifUtil.read(Tools.getGifPath('rnaples-offsets-public'))
.then(actualGif => {
const actualBitmapImage = actualGif.frames[10];
return Tools.saveBitmapImage(actualBitmapImage, Tools.getImagePath('rnaples-check.png'))
.then(() => {
return Tools.loadBitmapImage(Tools.getImagePath('rnaples-frame-10.png'));
})
.then(expectedBitmapImage => {
const expectedBitmap = expectedBitmapImage.bitmap;
Tools.checkBitmap(
actualBitmapImage.bitmap,
expectedBitmap.width,
expectedBitmap.height,
expectedBitmap.data
);
});
actualBitmapImage = actualGif.frames[10];
return Tools.loadBitmapImage(Tools.getImagePath('rnaples-frame-10.png'));
})
.then(expectedBitmapImage => {
const expectedBitmap = expectedBitmapImage.bitmap;
Tools.checkBitmap(
actualBitmapImage.bitmap,
expectedBitmap.width,
expectedBitmap.height,
expectedBitmap.data
);
});
});
});
Expand Down

0 comments on commit 70ca28f

Please sign in to comment.