chore: add jimp dependency, icon padding script, and update configuration

This commit is contained in:
2026-05-31 14:04:37 +02:00
parent 30f81045ac
commit 7cd17307ba
1126 changed files with 166400 additions and 2 deletions
BIN
View File
Binary file not shown.
+35
View File
@@ -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/);
});
});