Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MR414N-ID
GitHub Repository: MR414N-ID/botku2
Path: blob/master/node_modules/@jimp/gif/test/gif.test.js
1126 views
1
import { Jimp, getTestDir } from '@jimp/test-utils';
2
import configure from '@jimp/custom';
3
4
import gif from '../src';
5
6
const jimp = configure({ types: [gif] }, Jimp);
7
8
describe('GIF', () => {
9
const imagesDir = getTestDir(__dirname) + '/images';
10
11
it('load GIF', async () => {
12
const image = await jimp.read(imagesDir + '/flower.gif');
13
image.getPixelColor(10, 10).should.be.equal(0xe5e6d9ff);
14
});
15
16
it('load animated GIF', async () => {
17
const image = await jimp.read(imagesDir + '/animated.gif');
18
image.getPixelColor(10, 10).should.be.equal(0xa1d2f1ff);
19
});
20
21
it('export GIF', async () => {
22
const jgd = await jimp.read(imagesDir + '/flower.gif');
23
const buffer = await jgd.getBufferAsync('image/gif');
24
buffer
25
.toString()
26
.startsWith('GIF')
27
.should.be.equal(true);
28
});
29
});
30
31