chore: add jimp dependency, icon padding script, and update configuration
This commit is contained in:
+114
@@ -0,0 +1,114 @@
|
||||
# v0.22.9 (Wed Jul 26 2023)
|
||||
|
||||
:tada: This release contains work from a new contributor! :tada:
|
||||
|
||||
Thank you, Nicolas Morel ([@Marsup](https://github.com/Marsup)), for all your work!
|
||||
|
||||
#### 🚀 Enhancement
|
||||
|
||||
- chore: upgrade gifwrap [#1222](https://github.com/jimp-dev/jimp/pull/1222) ([@Marsup](https://github.com/Marsup))
|
||||
|
||||
#### Authors: 1
|
||||
|
||||
- Nicolas Morel ([@Marsup](https://github.com/Marsup))
|
||||
|
||||
---
|
||||
|
||||
# v0.22.1 (Mon Feb 06 2023)
|
||||
|
||||
#### 🏠 Internal
|
||||
|
||||
- rename master to main [#1169](https://github.com/jimp-dev/jimp/pull/1169) ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
||||
|
||||
#### Authors: 1
|
||||
|
||||
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
||||
|
||||
---
|
||||
|
||||
# v0.22.0 (Mon Feb 06 2023)
|
||||
|
||||
#### 🏠 Internal
|
||||
|
||||
- switch from should to expect [#1163](https://github.com/jimp-dev/jimp/pull/1163) ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
||||
- Change test matching strategy to include all test files [#1161](https://github.com/jimp-dev/jimp/pull/1161) ([@danielholmes](https://github.com/danielholmes))
|
||||
|
||||
#### Authors: 2
|
||||
|
||||
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
||||
- Daniel Holmes ([@danielholmes](https://github.com/danielholmes))
|
||||
|
||||
---
|
||||
|
||||
# v0.21.0 (Sun Feb 05 2023)
|
||||
|
||||
### Release Notes
|
||||
|
||||
#### Babel Refactor ([#1149](https://github.com/jimp-dev/jimp/pull/1149))
|
||||
|
||||
Marking this as a "breaking release" because it might change what deps need to be installed.
|
||||
|
||||
All modules should be exported as valid cjs and esm
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
#### 💥 Breaking Change
|
||||
|
||||
- Babel Refactor [#1149](https://github.com/jimp-dev/jimp/pull/1149) ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
||||
|
||||
#### Authors: 1
|
||||
|
||||
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
||||
|
||||
---
|
||||
|
||||
# v0.16.3 (Sat Feb 04 2023)
|
||||
|
||||
#### ⚠️ Pushed to `main`
|
||||
|
||||
- upgrade prettier ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
||||
|
||||
#### Authors: 1
|
||||
|
||||
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
||||
|
||||
---
|
||||
|
||||
# v0.13.0 (Fri Jun 05 2020)
|
||||
|
||||
#### 🚀 Enhancement
|
||||
|
||||
- Add single frame encoder for type-gif [#899](https://github.com/oliver-moran/jimp/pull/899) ([@jeffbseeking](https://github.com/jeffbseeking) [@hipstersmoothie](https://github.com/hipstersmoothie))
|
||||
|
||||
#### Authors: 2
|
||||
|
||||
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
||||
- Jeff Bonnes ([@jeffbseeking](https://github.com/jeffbseeking))
|
||||
|
||||
---
|
||||
|
||||
# v0.11.0 (Fri May 15 2020)
|
||||
|
||||
#### 🚀 Enhancement
|
||||
|
||||
- Removed Core-JS as a dependency. [#882](https://github.com/oliver-moran/jimp/pull/882) ([@EricRabil](https://github.com/EricRabil))
|
||||
|
||||
#### Authors: 1
|
||||
|
||||
- Eric Rabil ([@EricRabil](https://github.com/EricRabil))
|
||||
|
||||
---
|
||||
|
||||
# v0.9.3 (Tue Nov 26 2019)
|
||||
|
||||
#### 🐛 Bug Fix
|
||||
|
||||
- `@jimp/cli`, `@jimp/core`, `@jimp/custom`, `jimp`, `@jimp/plugin-blit`, `@jimp/plugin-blur`, `@jimp/plugin-circle`, `@jimp/plugin-color`, `@jimp/plugin-contain`, `@jimp/plugin-cover`, `@jimp/plugin-crop`, `@jimp/plugin-displace`, `@jimp/plugin-dither`, `@jimp/plugin-fisheye`, `@jimp/plugin-flip`, `@jimp/plugin-gaussian`, `@jimp/plugin-invert`, `@jimp/plugin-mask`, `@jimp/plugin-normalize`, `@jimp/plugin-print`, `@jimp/plugin-resize`, `@jimp/plugin-rotate`, `@jimp/plugin-scale`, `@jimp/plugin-shadow`, `@jimp/plugin-threshold`, `@jimp/plugins`, `@jimp/test-utils`, `@jimp/bmp`, `@jimp/gif`, `@jimp/jpeg`, `@jimp/png`, `@jimp/tiff`, `@jimp/types`, `@jimp/utils`
|
||||
- Fix regeneratorRuntime errors [#815](https://github.com/oliver-moran/jimp/pull/815) ([@crutchcorn](https://github.com/crutchcorn) [@hipstersmoothie](https://github.com/hipstersmoothie))
|
||||
|
||||
#### Authors: 2
|
||||
|
||||
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
||||
- Corbin Crutchley ([@crutchcorn](https://github.com/crutchcorn))
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Oliver Moran
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<div align="center">
|
||||
<img width="200" height="200"
|
||||
src="https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-11/256/crayon.png">
|
||||
<h1>@jimp/gif</h1>
|
||||
<p>Default Jimp gif decoder.</p>
|
||||
</div>
|
||||
|
||||
NOTE: Encoder currently unavailable.
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
import GIF from "omggif";
|
||||
import { GifUtil, GifFrame, BitmapImage, GifCodec } from "gifwrap";
|
||||
const MIME_TYPE = "image/gif";
|
||||
export default (() => ({
|
||||
mime: {
|
||||
[MIME_TYPE]: ["gif"]
|
||||
},
|
||||
constants: {
|
||||
MIME_GIF: MIME_TYPE
|
||||
},
|
||||
decoders: {
|
||||
[MIME_TYPE]: data => {
|
||||
const gifObj = new GIF.GifReader(data);
|
||||
const gifData = Buffer.alloc(gifObj.width * gifObj.height * 4);
|
||||
gifObj.decodeAndBlitFrameRGBA(0, gifData);
|
||||
return {
|
||||
data: gifData,
|
||||
width: gifObj.width,
|
||||
height: gifObj.height
|
||||
};
|
||||
}
|
||||
},
|
||||
encoders: {
|
||||
[MIME_TYPE]: data => {
|
||||
const bitmap = new BitmapImage(data.bitmap);
|
||||
GifUtil.quantizeDekker(bitmap, 256);
|
||||
const newFrame = new GifFrame(bitmap);
|
||||
const gifCodec = new GifCodec();
|
||||
return gifCodec.encodeGif([newFrame], {}).then(newGif => {
|
||||
return newGif.buffer;
|
||||
});
|
||||
}
|
||||
}
|
||||
}));
|
||||
//# sourceMappingURL=index.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","names":["GIF","GifUtil","GifFrame","BitmapImage","GifCodec","MIME_TYPE","mime","constants","MIME_GIF","decoders","data","gifObj","GifReader","gifData","Buffer","alloc","width","height","decodeAndBlitFrameRGBA","encoders","bitmap","quantizeDekker","newFrame","gifCodec","encodeGif","then","newGif","buffer"],"sources":["../src/index.js"],"sourcesContent":["import GIF from \"omggif\";\nimport { GifUtil, GifFrame, BitmapImage, GifCodec } from \"gifwrap\";\n\nconst MIME_TYPE = \"image/gif\";\n\nexport default () => ({\n mime: { [MIME_TYPE]: [\"gif\"] },\n\n constants: {\n MIME_GIF: MIME_TYPE,\n },\n\n decoders: {\n [MIME_TYPE]: (data) => {\n const gifObj = new GIF.GifReader(data);\n const gifData = Buffer.alloc(gifObj.width * gifObj.height * 4);\n\n gifObj.decodeAndBlitFrameRGBA(0, gifData);\n\n return {\n data: gifData,\n width: gifObj.width,\n height: gifObj.height,\n };\n },\n },\n\n encoders: {\n [MIME_TYPE]: (data) => {\n const bitmap = new BitmapImage(data.bitmap);\n GifUtil.quantizeDekker(bitmap, 256);\n const newFrame = new GifFrame(bitmap);\n const gifCodec = new GifCodec();\n return gifCodec.encodeGif([newFrame], {}).then((newGif) => {\n return newGif.buffer;\n });\n },\n },\n});\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,QAAQ;AACxB,SAASC,OAAO,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,SAAS;AAElE,MAAMC,SAAS,GAAG,WAAW;AAE7B,gBAAe,OAAO;EACpBC,IAAI,EAAE;IAAE,CAACD,SAAS,GAAG,CAAC,KAAK;EAAE,CAAC;EAE9BE,SAAS,EAAE;IACTC,QAAQ,EAAEH;EACZ,CAAC;EAEDI,QAAQ,EAAE;IACR,CAACJ,SAAS,GAAIK,IAAI,IAAK;MACrB,MAAMC,MAAM,GAAG,IAAIX,GAAG,CAACY,SAAS,CAACF,IAAI,CAAC;MACtC,MAAMG,OAAO,GAAGC,MAAM,CAACC,KAAK,CAACJ,MAAM,CAACK,KAAK,GAAGL,MAAM,CAACM,MAAM,GAAG,CAAC,CAAC;MAE9DN,MAAM,CAACO,sBAAsB,CAAC,CAAC,EAAEL,OAAO,CAAC;MAEzC,OAAO;QACLH,IAAI,EAAEG,OAAO;QACbG,KAAK,EAAEL,MAAM,CAACK,KAAK;QACnBC,MAAM,EAAEN,MAAM,CAACM;MACjB,CAAC;IACH;EACF,CAAC;EAEDE,QAAQ,EAAE;IACR,CAACd,SAAS,GAAIK,IAAI,IAAK;MACrB,MAAMU,MAAM,GAAG,IAAIjB,WAAW,CAACO,IAAI,CAACU,MAAM,CAAC;MAC3CnB,OAAO,CAACoB,cAAc,CAACD,MAAM,EAAE,GAAG,CAAC;MACnC,MAAME,QAAQ,GAAG,IAAIpB,QAAQ,CAACkB,MAAM,CAAC;MACrC,MAAMG,QAAQ,GAAG,IAAInB,QAAQ,EAAE;MAC/B,OAAOmB,QAAQ,CAACC,SAAS,CAAC,CAACF,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAACG,IAAI,CAAEC,MAAM,IAAK;QACzD,OAAOA,MAAM,CAACC,MAAM;MACtB,CAAC,CAAC;IACJ;EACF;AACF,CAAC,CAAC"}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import { DecoderFn } from "@jimp/core";
|
||||
|
||||
interface Gif {
|
||||
mime: {
|
||||
"image/gif": string[];
|
||||
};
|
||||
|
||||
constants: {
|
||||
MIME_GIF: "image/gif";
|
||||
};
|
||||
|
||||
decoders: {
|
||||
"image/gif": DecoderFn;
|
||||
};
|
||||
}
|
||||
|
||||
export default function (): Gif;
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "@jimp/gif",
|
||||
"version": "0.22.12",
|
||||
"description": "Default Jimp gif encoder/decoder.",
|
||||
"main": "dist/index.js",
|
||||
"module": "es/index.js",
|
||||
"repository": "jimp-dev/jimp",
|
||||
"types": "index.d.ts",
|
||||
"scripts": {
|
||||
"test": "cross-env BABEL_ENV=test mocha --require @babel/register --recursive test --extension js",
|
||||
"test:watch": "npm run test -- --reporter min --watch",
|
||||
"test:coverage": "nyc npm run test",
|
||||
"build": "npm run build:node:production && npm run build:module",
|
||||
"build:watch": "npm run build:node:debug -- -- --watch --verbose",
|
||||
"build:debug": "npm run build:node:debug",
|
||||
"build:module": "cross-env BABEL_ENV=module babel src -d es --source-maps --config-file ../../babel.config.js",
|
||||
"build:node": "babel src -d dist --source-maps --config-file ../../babel.config.js",
|
||||
"build:node:debug": "cross-env BABEL_ENV=development npm run build:node",
|
||||
"build:node:production": "cross-env BABEL_ENV=production npm run build:node"
|
||||
},
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jimp/utils": "^0.22.12",
|
||||
"gifwrap": "^0.10.1",
|
||||
"omggif": "^1.0.9"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@jimp/custom": ">=0.3.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jimp/custom": "^0.22.12",
|
||||
"@jimp/test-utils": "^0.22.12"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "a4a8d6364bbf97629749e196f3b0a4c94c9a7abc"
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
import GIF from "omggif";
|
||||
import { GifUtil, GifFrame, BitmapImage, GifCodec } from "gifwrap";
|
||||
|
||||
const MIME_TYPE = "image/gif";
|
||||
|
||||
export default () => ({
|
||||
mime: { [MIME_TYPE]: ["gif"] },
|
||||
|
||||
constants: {
|
||||
MIME_GIF: MIME_TYPE,
|
||||
},
|
||||
|
||||
decoders: {
|
||||
[MIME_TYPE]: (data) => {
|
||||
const gifObj = new GIF.GifReader(data);
|
||||
const gifData = Buffer.alloc(gifObj.width * gifObj.height * 4);
|
||||
|
||||
gifObj.decodeAndBlitFrameRGBA(0, gifData);
|
||||
|
||||
return {
|
||||
data: gifData,
|
||||
width: gifObj.width,
|
||||
height: gifObj.height,
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
encoders: {
|
||||
[MIME_TYPE]: (data) => {
|
||||
const bitmap = new BitmapImage(data.bitmap);
|
||||
GifUtil.quantizeDekker(bitmap, 256);
|
||||
const newFrame = new GifFrame(bitmap);
|
||||
const gifCodec = new GifCodec();
|
||||
return gifCodec.encodeGif([newFrame], {}).then((newGif) => {
|
||||
return newGif.buffer;
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
import { Jimp, getTestDir } from "@jimp/test-utils";
|
||||
import configure from "@jimp/custom";
|
||||
import expect from "@storybook/expect";
|
||||
|
||||
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");
|
||||
expect(image.getPixelColor(10, 10)).toBe(0xe5e6d9ff);
|
||||
});
|
||||
|
||||
it("load animated GIF", async () => {
|
||||
const image = await jimp.read(imagesDir + "/animated.gif");
|
||||
expect(image.getPixelColor(10, 10)).toBe(0xa1d2f1ff);
|
||||
});
|
||||
|
||||
it("export GIF", async () => {
|
||||
const jgd = await jimp.read(imagesDir + "/flower.gif");
|
||||
const buffer = await jgd.getBufferAsync("image/gif");
|
||||
expect(buffer.toString()).toMatch(/^GIF/);
|
||||
});
|
||||
});
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 81 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 52 KiB |
Reference in New Issue
Block a user