chore: add jimp dependency, icon padding script, and update configuration
This commit is contained in:
+97
@@ -0,0 +1,97 @@
|
||||
# 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.18.0 (Sun Feb 05 2023)
|
||||
|
||||
#### 🚀 Enhancement
|
||||
|
||||
- Update utif [#1143](https://github.com/jimp-dev/jimp/pull/1143) ([@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.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.
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<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/tiff</h1>
|
||||
<p>Default Jimp tiff encoder/decoder.</p>
|
||||
</div>
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
import utif from "utif2";
|
||||
const MIME_TYPE = "image/tiff";
|
||||
export default (() => ({
|
||||
mime: {
|
||||
[MIME_TYPE]: ["tiff", "tif"]
|
||||
},
|
||||
constants: {
|
||||
MIME_TIFF: MIME_TYPE
|
||||
},
|
||||
decoders: {
|
||||
[MIME_TYPE]: data => {
|
||||
const ifds = utif.decode(data);
|
||||
const page = ifds[0];
|
||||
ifds.forEach(ifd => {
|
||||
utif.decodeImage(data, ifd);
|
||||
});
|
||||
const rgba = utif.toRGBA8(page);
|
||||
return {
|
||||
data: Buffer.from(rgba),
|
||||
width: page.t256[0],
|
||||
height: page.t257[0]
|
||||
};
|
||||
}
|
||||
},
|
||||
encoders: {
|
||||
[MIME_TYPE]: image => {
|
||||
const tiff = utif.encodeImage(image.bitmap.data, image.bitmap.width, image.bitmap.height);
|
||||
return Buffer.from(tiff);
|
||||
}
|
||||
}
|
||||
}));
|
||||
//# sourceMappingURL=index.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","names":["utif","MIME_TYPE","mime","constants","MIME_TIFF","decoders","data","ifds","decode","page","forEach","ifd","decodeImage","rgba","toRGBA8","Buffer","from","width","t256","height","t257","encoders","image","tiff","encodeImage","bitmap"],"sources":["../src/index.js"],"sourcesContent":["import utif from \"utif2\";\n\nconst MIME_TYPE = \"image/tiff\";\n\nexport default () => ({\n mime: { [MIME_TYPE]: [\"tiff\", \"tif\"] },\n\n constants: {\n MIME_TIFF: MIME_TYPE,\n },\n\n decoders: {\n [MIME_TYPE]: (data) => {\n const ifds = utif.decode(data);\n const page = ifds[0];\n\n ifds.forEach((ifd) => {\n utif.decodeImage(data, ifd);\n });\n\n const rgba = utif.toRGBA8(page);\n\n return {\n data: Buffer.from(rgba),\n width: page.t256[0],\n height: page.t257[0],\n };\n },\n },\n\n encoders: {\n [MIME_TYPE]: (image) => {\n const tiff = utif.encodeImage(\n image.bitmap.data,\n image.bitmap.width,\n image.bitmap.height\n );\n\n return Buffer.from(tiff);\n },\n },\n});\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,OAAO;AAExB,MAAMC,SAAS,GAAG,YAAY;AAE9B,gBAAe,OAAO;EACpBC,IAAI,EAAE;IAAE,CAACD,SAAS,GAAG,CAAC,MAAM,EAAE,KAAK;EAAE,CAAC;EAEtCE,SAAS,EAAE;IACTC,SAAS,EAAEH;EACb,CAAC;EAEDI,QAAQ,EAAE;IACR,CAACJ,SAAS,GAAIK,IAAI,IAAK;MACrB,MAAMC,IAAI,GAAGP,IAAI,CAACQ,MAAM,CAACF,IAAI,CAAC;MAC9B,MAAMG,IAAI,GAAGF,IAAI,CAAC,CAAC,CAAC;MAEpBA,IAAI,CAACG,OAAO,CAAEC,GAAG,IAAK;QACpBX,IAAI,CAACY,WAAW,CAACN,IAAI,EAAEK,GAAG,CAAC;MAC7B,CAAC,CAAC;MAEF,MAAME,IAAI,GAAGb,IAAI,CAACc,OAAO,CAACL,IAAI,CAAC;MAE/B,OAAO;QACLH,IAAI,EAAES,MAAM,CAACC,IAAI,CAACH,IAAI,CAAC;QACvBI,KAAK,EAAER,IAAI,CAACS,IAAI,CAAC,CAAC,CAAC;QACnBC,MAAM,EAAEV,IAAI,CAACW,IAAI,CAAC,CAAC;MACrB,CAAC;IACH;EACF,CAAC;EAEDC,QAAQ,EAAE;IACR,CAACpB,SAAS,GAAIqB,KAAK,IAAK;MACtB,MAAMC,IAAI,GAAGvB,IAAI,CAACwB,WAAW,CAC3BF,KAAK,CAACG,MAAM,CAACnB,IAAI,EACjBgB,KAAK,CAACG,MAAM,CAACR,KAAK,EAClBK,KAAK,CAACG,MAAM,CAACN,MAAM,CACpB;MAED,OAAOJ,MAAM,CAACC,IAAI,CAACO,IAAI,CAAC;IAC1B;EACF;AACF,CAAC,CAAC"}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
import { DecoderFn, EncoderFn } from "@jimp/core";
|
||||
|
||||
interface Tiff {
|
||||
mime: { "image/tiff": string[] };
|
||||
decoders: {
|
||||
"image/tiff": DecoderFn;
|
||||
};
|
||||
encoders: {
|
||||
"image/tiff": EncoderFn;
|
||||
};
|
||||
constants: {
|
||||
MIME_TIFF: "image/tiff";
|
||||
};
|
||||
}
|
||||
|
||||
export default function (): Tiff;
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "@jimp/tiff",
|
||||
"version": "0.22.12",
|
||||
"description": "Default Jimp tiff 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": {
|
||||
"utif2": "^4.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@jimp/custom": ">=0.3.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jimp/custom": "^0.22.12",
|
||||
"@jimp/test-utils": "^0.22.12"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "a4a8d6364bbf97629749e196f3b0a4c94c9a7abc"
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
import utif from "utif2";
|
||||
|
||||
const MIME_TYPE = "image/tiff";
|
||||
|
||||
export default () => ({
|
||||
mime: { [MIME_TYPE]: ["tiff", "tif"] },
|
||||
|
||||
constants: {
|
||||
MIME_TIFF: MIME_TYPE,
|
||||
},
|
||||
|
||||
decoders: {
|
||||
[MIME_TYPE]: (data) => {
|
||||
const ifds = utif.decode(data);
|
||||
const page = ifds[0];
|
||||
|
||||
ifds.forEach((ifd) => {
|
||||
utif.decodeImage(data, ifd);
|
||||
});
|
||||
|
||||
const rgba = utif.toRGBA8(page);
|
||||
|
||||
return {
|
||||
data: Buffer.from(rgba),
|
||||
width: page.t256[0],
|
||||
height: page.t257[0],
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
encoders: {
|
||||
[MIME_TYPE]: (image) => {
|
||||
const tiff = utif.encodeImage(
|
||||
image.bitmap.data,
|
||||
image.bitmap.width,
|
||||
image.bitmap.height
|
||||
);
|
||||
|
||||
return Buffer.from(tiff);
|
||||
},
|
||||
},
|
||||
});
|
||||
BIN
Binary file not shown.
+35
@@ -0,0 +1,35 @@
|
||||
import { Jimp, getTestDir } from "@jimp/test-utils";
|
||||
import configure from "@jimp/custom";
|
||||
import expect from "@storybook/expect";
|
||||
|
||||
import tiff from "../src";
|
||||
|
||||
const jimp = configure({ types: [tiff] }, Jimp);
|
||||
|
||||
describe("TIFF", () => {
|
||||
const imagesDir = getTestDir(__dirname) + "/images";
|
||||
|
||||
it("load TIFF", async () => {
|
||||
const image = await jimp.read(imagesDir + "/rgb.tiff");
|
||||
|
||||
expect(image.getPixelColor(10, 10)).toBe(0xa4988bff);
|
||||
expect(image.getPixelColor(220, 190)).toBe(0xe0d7ddff);
|
||||
expect(image.getPixelColor(350, 130)).toBe(0x565433ff);
|
||||
});
|
||||
|
||||
const simpleJGD = {
|
||||
width: 3,
|
||||
height: 3,
|
||||
data: [
|
||||
0xff0000ff, 0xff0080ff, 0xff00ffff, 0xff0080ff, 0xff00ffff, 0x8000ffff,
|
||||
0xff00ffff, 0x8000ffff, 0x0000ffff,
|
||||
],
|
||||
};
|
||||
|
||||
it("export TIFF", async () => {
|
||||
const image = await jimp.read(simpleJGD);
|
||||
const buffer = await image.getBufferAsync("image/tiff");
|
||||
|
||||
expect(buffer.toString()).toMatch(/^MM\u0000*\u0000/);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user