-
-
Notifications
You must be signed in to change notification settings - Fork 763
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add single frame encoder for type-gif (#899)
* Add single frame encoder for type-gif * Fix linting errors * Update packages/type-gif/package.json Co-authored-by: Andrew Lisowski <[email protected]>
- Loading branch information
1 parent
612cef4
commit fcc5b23
Showing
7 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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); | ||
}); | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.