First commit

This commit is contained in:
2026-01-12 13:12:46 +01:00
parent b2d9501f6d
commit a1fbd8acf5
4413 changed files with 1245183 additions and 0 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

113141
node_modules/png-js/test/__snapshots__/pixels.spec.js.snap generated vendored Normal file

File diff suppressed because it is too large Load Diff

BIN
node_modules/png-js/test/images/animated.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
node_modules/png-js/test/images/black-white.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

BIN
node_modules/png-js/test/images/grayscale-16bit.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

BIN
node_modules/png-js/test/images/grayscale-8bit.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

BIN
node_modules/png-js/test/images/interlaced-rgb-8bit.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

BIN
node_modules/png-js/test/images/rgb-16bit.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

BIN
node_modules/png-js/test/images/rgb-8bit.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

BIN
node_modules/png-js/test/images/rgb-alpha-16bit.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
node_modules/png-js/test/images/rgb-alpha-8bit.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

23
node_modules/png-js/test/imgdata.spec.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
const PNGNode = require('../png-node');
const fs = require('fs');
const files = fs.readdirSync('test/images');
function getImgData(Ctor, fileName) {
const image = new Ctor(fs.readFileSync(`test/images/${fileName}`));
return image.imgData;
}
describe('imgData', () => {
describe('node', () => {
test.each(files)('%s', fileName => {
expect(getImgData(PNGNode, fileName)).toMatchSnapshot();
});
});
describe('browser', () => {
test.each(files)('%s', fileName => {
expect(getImgData(PNG, fileName)).toMatchSnapshot();
});
});
});

24
node_modules/png-js/test/metadata.spec.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
const PNGNode = require('../png-node');
const fs = require('fs');
const files = fs.readdirSync('test/images');
function getMetaData(Ctor, fileName) {
const image = new Ctor(fs.readFileSync(`test/images/${fileName}`));
const { imgData, data, ...metadata } = image;
return metadata;
}
describe('metadata', () => {
describe('node', () => {
test.each(files)('%s', fileName => {
expect(getMetaData(PNGNode, fileName)).toMatchSnapshot();
});
});
describe('browser', () => {
test.each(files)('%s', fileName => {
expect(getMetaData(PNG, fileName)).toMatchSnapshot();
});
});
});

1
node_modules/png-js/test/patch-canvas.js generated vendored Normal file
View File

@@ -0,0 +1 @@
HTMLCanvasElement.prototype.getContext = function() {};

29
node_modules/png-js/test/pixels.spec.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
const PNGNode = require('../png-node');
const fs = require('fs');
const files = fs.readdirSync('test/images');
async function getPixels(Ctor, fileName) {
const image = new Ctor(fs.readFileSync(`test/images/${fileName}`));
return new Promise(resolve => {
Ctor === PNGNode
? image.decodePixels(resolve)
: resolve(image.decodePixels());
});
}
describe('pixels', () => {
describe('node', () => {
test.each(files)('%s', async fileName => {
const pixels = await getPixels(PNGNode, fileName);
expect(pixels).toMatchSnapshot();
});
});
describe('browser', () => {
test.each(files)('%s', async fileName => {
const pixels = await getPixels(PNG, fileName);
expect(pixels).toMatchSnapshot();
});
});
});