This commit is contained in:
2026-03-25 14:14:07 +01:00
parent d6b31e2ef7
commit a0073b4fb1
10368 changed files with 2214340 additions and 0 deletions

30
APP/nexus-remote/node_modules/png-to-ico/lib/png.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
import { promises as pfs } from "node:fs";
import { PNG } from "pngjs";
import Resize from "./resize.js";
async function readPNG(filepath) {
try {
let data;
if (Buffer.isBuffer(filepath)) {
data = filepath;
} else {
data = await pfs.readFile(filepath);
}
return PNG.sync.read(data);
} catch (err) {
throw new Error(`${filepath} is not or a valid PNG file.`);
}
}
function resize(src, width, height, interpolation = "bicubicInterpolation") {
const result = createPNG(width, height);
Resize[interpolation](src, result);
return result;
}
function createPNG(width = 256, height = 256) {
return new PNG({ width, height });
}
export { readPNG, resize };