first commit

This commit is contained in:
2026-07-19 03:44:35 +09:00
commit 7f950339ae
23281 changed files with 3217138 additions and 0 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

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
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
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
View File
@@ -0,0 +1 @@
HTMLCanvasElement.prototype.getContext = function() {};
+29
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();
});
});
});