forked from jimp-dev/jimp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gif.test.js
29 lines (23 loc) · 826 Bytes
/
gif.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { Jimp, getTestDir } from '@jimp/test-utils';
import configure from '@jimp/custom';
import gif from '../src';
const jimp = configure({ types: [gif] }, Jimp);
describe('GIF', () => {
const imagesDir = getTestDir(__dirname) + '/images';
it('load GIF', async () => {
const image = await jimp.read(imagesDir + '/flower.gif');
image.getPixelColor(10, 10).should.be.equal(0xe5e6d9ff);
});
it('load animated GIF', async () => {
const image = await jimp.read(imagesDir + '/animated.gif');
image.getPixelColor(10, 10).should.be.equal(0xa1d2f1ff);
});
it('export GIF', async () => {
const jgd = await jimp.read(imagesDir + '/flower.gif');
const buffer = await jgd.getBufferAsync('image/gif');
buffer
.toString()
.startsWith('GIF')
.should.be.equal(true);
});
});