Spaces:
Paused
Paused
Upload folder using huggingface_hub (part 8)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +2 -0
- node_modules/@jimp/file-ops/.tshy/browser.json +16 -0
- node_modules/@jimp/file-ops/.tshy/build.json +8 -0
- node_modules/@jimp/file-ops/.tshy/commonjs.json +18 -0
- node_modules/@jimp/file-ops/.tshy/esm.json +17 -0
- node_modules/@jimp/file-ops/CHANGELOG.md +51 -0
- node_modules/@jimp/file-ops/LICENSE +21 -0
- node_modules/@jimp/file-ops/dist/browser/index-browser.d.mts.map +1 -0
- node_modules/@jimp/file-ops/dist/browser/index-browser.mjs.map +1 -0
- node_modules/@jimp/file-ops/dist/browser/index.d.ts +4 -0
- node_modules/@jimp/file-ops/dist/browser/index.js +8 -0
- node_modules/@jimp/file-ops/dist/browser/package.json +3 -0
- node_modules/@jimp/file-ops/dist/commonjs/index.d.ts +5 -0
- node_modules/@jimp/file-ops/dist/commonjs/index.d.ts.map +1 -0
- node_modules/@jimp/file-ops/dist/commonjs/index.js +9 -0
- node_modules/@jimp/file-ops/dist/commonjs/index.js.map +1 -0
- node_modules/@jimp/file-ops/dist/commonjs/package.json +3 -0
- node_modules/@jimp/file-ops/dist/esm/index.d.ts +5 -0
- node_modules/@jimp/file-ops/dist/esm/index.d.ts.map +1 -0
- node_modules/@jimp/file-ops/dist/esm/index.js +5 -0
- node_modules/@jimp/file-ops/dist/esm/index.js.map +1 -0
- node_modules/@jimp/file-ops/dist/esm/package.json +3 -0
- node_modules/@jimp/file-ops/eslint.config.mjs +2 -0
- node_modules/@jimp/file-ops/package.json +63 -0
- node_modules/@jimp/file-ops/src/index-browser.mts +9 -0
- node_modules/@jimp/file-ops/src/index.ts +5 -0
- node_modules/@jimp/file-ops/tsconfig.json +6 -0
- node_modules/@jimp/js-bmp/.tshy/build.json +8 -0
- node_modules/@jimp/js-bmp/.tshy/commonjs.json +17 -0
- node_modules/@jimp/js-bmp/.tshy/esm.json +16 -0
- node_modules/@jimp/js-bmp/CHANGELOG.md +73 -0
- node_modules/@jimp/js-bmp/LICENSE +21 -0
- node_modules/@jimp/js-bmp/README.md +6 -0
- node_modules/@jimp/js-bmp/dist/commonjs/index.d.ts +24 -0
- node_modules/@jimp/js-bmp/dist/commonjs/index.d.ts.map +1 -0
- node_modules/@jimp/js-bmp/dist/commonjs/index.js +74 -0
- node_modules/@jimp/js-bmp/dist/commonjs/index.js.map +1 -0
- node_modules/@jimp/js-bmp/dist/commonjs/package.json +3 -0
- node_modules/@jimp/js-bmp/dist/esm/index.d.ts +24 -0
- node_modules/@jimp/js-bmp/dist/esm/index.d.ts.map +1 -0
- node_modules/@jimp/js-bmp/dist/esm/index.js +45 -0
- node_modules/@jimp/js-bmp/dist/esm/index.js.map +1 -0
- node_modules/@jimp/js-bmp/dist/esm/package.json +3 -0
- node_modules/@jimp/js-bmp/eslint.config.mjs +2 -0
- node_modules/@jimp/js-bmp/package.json +69 -0
- node_modules/@jimp/js-bmp/src/images/windows95.bmp +3 -0
- node_modules/@jimp/js-bmp/src/images/windows95.png +0 -0
- node_modules/@jimp/js-bmp/src/index.node.test.ts +17 -0
- node_modules/@jimp/js-bmp/src/index.test.ts +32 -0
- node_modules/@jimp/js-bmp/src/index.ts +99 -0
.gitattributes
CHANGED
|
@@ -25,3 +25,5 @@
|
|
| 25 |
*.eot binary
|
| 26 |
*.pdf binary
|
| 27 |
*.zip binary
|
|
|
|
|
|
|
|
|
| 25 |
*.eot binary
|
| 26 |
*.pdf binary
|
| 27 |
*.zip binary
|
| 28 |
+
node_modules/@jimp/js-bmp/src/images/windows95.bmp filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
node_modules/@jimp/js-bmp/src/images/windows95.png filter=lfs diff=lfs merge=lfs -text
|
node_modules/@jimp/file-ops/.tshy/browser.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"extends": "./build.json",
|
| 3 |
+
"include": [
|
| 4 |
+
"../src/**/*.ts",
|
| 5 |
+
"../src/**/*.mts",
|
| 6 |
+
"../src/**/*.tsx",
|
| 7 |
+
"../src/**/*.json"
|
| 8 |
+
],
|
| 9 |
+
"exclude": [
|
| 10 |
+
"../**/*.test.ts",
|
| 11 |
+
"../src/package.json"
|
| 12 |
+
],
|
| 13 |
+
"compilerOptions": {
|
| 14 |
+
"outDir": "../.tshy-build/browser"
|
| 15 |
+
}
|
| 16 |
+
}
|
node_modules/@jimp/file-ops/.tshy/build.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"extends": "../tsconfig.json",
|
| 3 |
+
"compilerOptions": {
|
| 4 |
+
"rootDir": "../src",
|
| 5 |
+
"module": "nodenext",
|
| 6 |
+
"moduleResolution": "nodenext"
|
| 7 |
+
}
|
| 8 |
+
}
|
node_modules/@jimp/file-ops/.tshy/commonjs.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"extends": "./build.json",
|
| 3 |
+
"include": [
|
| 4 |
+
"../src/**/*.ts",
|
| 5 |
+
"../src/**/*.cts",
|
| 6 |
+
"../src/**/*.tsx",
|
| 7 |
+
"../src/**/*.json"
|
| 8 |
+
],
|
| 9 |
+
"exclude": [
|
| 10 |
+
"../**/*.test.ts",
|
| 11 |
+
"../src/**/*.mts",
|
| 12 |
+
"../src/package.json",
|
| 13 |
+
"../src/index-browser.mts"
|
| 14 |
+
],
|
| 15 |
+
"compilerOptions": {
|
| 16 |
+
"outDir": "../.tshy-build/commonjs"
|
| 17 |
+
}
|
| 18 |
+
}
|
node_modules/@jimp/file-ops/.tshy/esm.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"extends": "./build.json",
|
| 3 |
+
"include": [
|
| 4 |
+
"../src/**/*.ts",
|
| 5 |
+
"../src/**/*.mts",
|
| 6 |
+
"../src/**/*.tsx",
|
| 7 |
+
"../src/**/*.json"
|
| 8 |
+
],
|
| 9 |
+
"exclude": [
|
| 10 |
+
"../**/*.test.ts",
|
| 11 |
+
"../src/package.json",
|
| 12 |
+
"../src/index-browser.mts"
|
| 13 |
+
],
|
| 14 |
+
"compilerOptions": {
|
| 15 |
+
"outDir": "../.tshy-build/esm"
|
| 16 |
+
}
|
| 17 |
+
}
|
node_modules/@jimp/file-ops/CHANGELOG.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# v1.1.3 (Mon Sep 02 2024)
|
| 2 |
+
|
| 3 |
+
#### 🐛 Bug Fix
|
| 4 |
+
|
| 5 |
+
- Update deps [#1319](https://github.com/jimp-dev/jimp/pull/1319) ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 6 |
+
|
| 7 |
+
#### Authors: 1
|
| 8 |
+
|
| 9 |
+
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 10 |
+
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# v1.1.0 (Sun Sep 01 2024)
|
| 14 |
+
|
| 15 |
+
#### ⚠️ Pushed to `main`
|
| 16 |
+
|
| 17 |
+
- upgrade tshy ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 18 |
+
|
| 19 |
+
#### Authors: 1
|
| 20 |
+
|
| 21 |
+
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 22 |
+
|
| 23 |
+
---
|
| 24 |
+
|
| 25 |
+
# v1.0.3 (Sat Aug 31 2024)
|
| 26 |
+
|
| 27 |
+
#### 🐛 Bug Fix
|
| 28 |
+
|
| 29 |
+
- Fix build [#1303](https://github.com/jimp-dev/jimp/pull/1303) ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 30 |
+
|
| 31 |
+
#### ⚠️ Pushed to `main`
|
| 32 |
+
|
| 33 |
+
- add clean script ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 34 |
+
|
| 35 |
+
#### Authors: 1
|
| 36 |
+
|
| 37 |
+
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 38 |
+
|
| 39 |
+
---
|
| 40 |
+
|
| 41 |
+
# v1.0.2 (Sat Aug 31 2024)
|
| 42 |
+
|
| 43 |
+
#### ⚠️ Pushed to `main`
|
| 44 |
+
|
| 45 |
+
- set side effects ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 46 |
+
- fix versions ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 47 |
+
- add publish config ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 48 |
+
|
| 49 |
+
#### Authors: 1
|
| 50 |
+
|
| 51 |
+
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
node_modules/@jimp/file-ops/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2018 Oliver Moran
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
node_modules/@jimp/file-ops/dist/browser/index-browser.d.mts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index-browser.d.mts","sourceRoot":"","sources":["../../src/index-browser.mts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,eAAc,CAAC;AAEtC,eAAO,MAAM,QAAQ,sBAEpB,CAAC;AAEF,eAAO,MAAM,SAAS,sBAErB,CAAC"}
|
node_modules/@jimp/file-ops/dist/browser/index-browser.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index-browser.mjs","sourceRoot":"","sources":["../../src/index-browser.mts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC;AAEtC,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAE;IACjC,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE;IAClC,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;AACnC,CAAC,CAAC"}
|
node_modules/@jimp/file-ops/dist/browser/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export declare const existsSync: () => boolean;
|
| 2 |
+
export declare const readFile: () => Promise<never>;
|
| 3 |
+
export declare const writeFile: () => Promise<never>;
|
| 4 |
+
//# sourceMappingURL=index-browser.d.mts.map
|
node_modules/@jimp/file-ops/dist/browser/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const existsSync = () => false;
|
| 2 |
+
export const readFile = async () => {
|
| 3 |
+
throw new Error("Not supported");
|
| 4 |
+
};
|
| 5 |
+
export const writeFile = async () => {
|
| 6 |
+
throw new Error("Not supported");
|
| 7 |
+
};
|
| 8 |
+
//# sourceMappingURL=index-browser.mjs.map
|
node_modules/@jimp/file-ops/dist/browser/package.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"type": "module"
|
| 3 |
+
}
|
node_modules/@jimp/file-ops/dist/commonjs/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { promises as fs } from "fs";
|
| 2 |
+
export { existsSync } from "fs";
|
| 3 |
+
export declare const readFile: typeof fs.readFile;
|
| 4 |
+
export declare const writeFile: typeof fs.writeFile;
|
| 5 |
+
//# sourceMappingURL=index.d.ts.map
|
node_modules/@jimp/file-ops/dist/commonjs/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,eAAO,MAAM,QAAQ,oBAAc,CAAC;AACpC,eAAO,MAAM,SAAS,qBAAe,CAAC"}
|
node_modules/@jimp/file-ops/dist/commonjs/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.writeFile = exports.readFile = exports.existsSync = void 0;
|
| 4 |
+
const fs_1 = require("fs");
|
| 5 |
+
var fs_2 = require("fs");
|
| 6 |
+
Object.defineProperty(exports, "existsSync", { enumerable: true, get: function () { return fs_2.existsSync; } });
|
| 7 |
+
exports.readFile = fs_1.promises.readFile;
|
| 8 |
+
exports.writeFile = fs_1.promises.writeFile;
|
| 9 |
+
//# sourceMappingURL=index.js.map
|
node_modules/@jimp/file-ops/dist/commonjs/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,2BAAoC;AAEpC,yBAAgC;AAAvB,gGAAA,UAAU,OAAA;AACN,QAAA,QAAQ,GAAG,aAAE,CAAC,QAAQ,CAAC;AACvB,QAAA,SAAS,GAAG,aAAE,CAAC,SAAS,CAAC"}
|
node_modules/@jimp/file-ops/dist/commonjs/package.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"type": "commonjs"
|
| 3 |
+
}
|
node_modules/@jimp/file-ops/dist/esm/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { promises as fs } from "fs";
|
| 2 |
+
export { existsSync } from "fs";
|
| 3 |
+
export declare const readFile: typeof fs.readFile;
|
| 4 |
+
export declare const writeFile: typeof fs.writeFile;
|
| 5 |
+
//# sourceMappingURL=index.d.ts.map
|
node_modules/@jimp/file-ops/dist/esm/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,eAAO,MAAM,QAAQ,oBAAc,CAAC;AACpC,eAAO,MAAM,SAAS,qBAAe,CAAC"}
|
node_modules/@jimp/file-ops/dist/esm/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { promises as fs } from "fs";
|
| 2 |
+
export { existsSync } from "fs";
|
| 3 |
+
export const readFile = fs.readFile;
|
| 4 |
+
export const writeFile = fs.writeFile;
|
| 5 |
+
//# sourceMappingURL=index.js.map
|
node_modules/@jimp/file-ops/dist/esm/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;AACpC,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,CAAC,SAAS,CAAC"}
|
node_modules/@jimp/file-ops/dist/esm/package.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"type": "module"
|
| 3 |
+
}
|
node_modules/@jimp/file-ops/eslint.config.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import shared from "@jimp/config-eslint/base.js";
|
| 2 |
+
export default [...shared];
|
node_modules/@jimp/file-ops/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@jimp/file-ops",
|
| 3 |
+
"version": "1.6.1",
|
| 4 |
+
"repository": "jimp-dev/jimp",
|
| 5 |
+
"engines": {
|
| 6 |
+
"node": ">=18"
|
| 7 |
+
},
|
| 8 |
+
"scripts": {
|
| 9 |
+
"lint": "eslint .",
|
| 10 |
+
"build": "tshy",
|
| 11 |
+
"dev": "tshy --watch",
|
| 12 |
+
"clean": "rm -rf node_modules .tshy .tshy-build dist .turbo"
|
| 13 |
+
},
|
| 14 |
+
"author": "Andrew Lisowski <lisowski54@gmail.com>",
|
| 15 |
+
"license": "MIT",
|
| 16 |
+
"devDependencies": {
|
| 17 |
+
"@jimp/config-eslint": "1.6.1",
|
| 18 |
+
"@jimp/config-typescript": "1.6.1",
|
| 19 |
+
"@types/node": "^18.19.48",
|
| 20 |
+
"eslint": "^9.9.1",
|
| 21 |
+
"tshy": "^3.0.2",
|
| 22 |
+
"typescript": "^5.5.4",
|
| 23 |
+
"vitest": "^2.0.5"
|
| 24 |
+
},
|
| 25 |
+
"tshy": {
|
| 26 |
+
"exclude": [
|
| 27 |
+
"**/*.test.ts"
|
| 28 |
+
],
|
| 29 |
+
"esmDialects": [
|
| 30 |
+
"browser"
|
| 31 |
+
],
|
| 32 |
+
"exports": {
|
| 33 |
+
"./package.json": "./package.json",
|
| 34 |
+
".": "./src/index.ts"
|
| 35 |
+
}
|
| 36 |
+
},
|
| 37 |
+
"exports": {
|
| 38 |
+
"./package.json": "./package.json",
|
| 39 |
+
".": {
|
| 40 |
+
"browser": {
|
| 41 |
+
"types": "./dist/browser/index.d.ts",
|
| 42 |
+
"default": "./dist/browser/index.js"
|
| 43 |
+
},
|
| 44 |
+
"import": {
|
| 45 |
+
"types": "./dist/esm/index.d.ts",
|
| 46 |
+
"default": "./dist/esm/index.js"
|
| 47 |
+
},
|
| 48 |
+
"require": {
|
| 49 |
+
"types": "./dist/commonjs/index.d.ts",
|
| 50 |
+
"default": "./dist/commonjs/index.js"
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
},
|
| 54 |
+
"main": "./dist/commonjs/index.js",
|
| 55 |
+
"types": "./dist/commonjs/index.d.ts",
|
| 56 |
+
"type": "module",
|
| 57 |
+
"publishConfig": {
|
| 58 |
+
"access": "public"
|
| 59 |
+
},
|
| 60 |
+
"sideEffects": false,
|
| 61 |
+
"module": "./dist/esm/index.js",
|
| 62 |
+
"gitHead": "7e6a95694e00a8b6f1bdd9aad709f5413eb9b08c"
|
| 63 |
+
}
|
node_modules/@jimp/file-ops/src/index-browser.mts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const existsSync = () => false;
|
| 2 |
+
|
| 3 |
+
export const readFile = async () => {
|
| 4 |
+
throw new Error("Not supported");
|
| 5 |
+
};
|
| 6 |
+
|
| 7 |
+
export const writeFile = async () => {
|
| 8 |
+
throw new Error("Not supported");
|
| 9 |
+
};
|
node_modules/@jimp/file-ops/src/index.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { promises as fs } from "fs";
|
| 2 |
+
|
| 3 |
+
export { existsSync } from "fs";
|
| 4 |
+
export const readFile = fs.readFile;
|
| 5 |
+
export const writeFile = fs.writeFile;
|
node_modules/@jimp/file-ops/tsconfig.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"extends": "@jimp/config-typescript/base.json",
|
| 3 |
+
"compilerOptions": {
|
| 4 |
+
"outDir": "dist"
|
| 5 |
+
}
|
| 6 |
+
}
|
node_modules/@jimp/js-bmp/.tshy/build.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"extends": "../tsconfig.json",
|
| 3 |
+
"compilerOptions": {
|
| 4 |
+
"rootDir": "../src",
|
| 5 |
+
"module": "nodenext",
|
| 6 |
+
"moduleResolution": "nodenext"
|
| 7 |
+
}
|
| 8 |
+
}
|
node_modules/@jimp/js-bmp/.tshy/commonjs.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"extends": "./build.json",
|
| 3 |
+
"include": [
|
| 4 |
+
"../src/**/*.ts",
|
| 5 |
+
"../src/**/*.cts",
|
| 6 |
+
"../src/**/*.tsx",
|
| 7 |
+
"../src/**/*.json"
|
| 8 |
+
],
|
| 9 |
+
"exclude": [
|
| 10 |
+
"../**/*.test.ts",
|
| 11 |
+
"../src/**/*.mts",
|
| 12 |
+
"../src/package.json"
|
| 13 |
+
],
|
| 14 |
+
"compilerOptions": {
|
| 15 |
+
"outDir": "../.tshy-build/commonjs"
|
| 16 |
+
}
|
| 17 |
+
}
|
node_modules/@jimp/js-bmp/.tshy/esm.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"extends": "./build.json",
|
| 3 |
+
"include": [
|
| 4 |
+
"../src/**/*.ts",
|
| 5 |
+
"../src/**/*.mts",
|
| 6 |
+
"../src/**/*.tsx",
|
| 7 |
+
"../src/**/*.json"
|
| 8 |
+
],
|
| 9 |
+
"exclude": [
|
| 10 |
+
"../**/*.test.ts",
|
| 11 |
+
"../src/package.json"
|
| 12 |
+
],
|
| 13 |
+
"compilerOptions": {
|
| 14 |
+
"outDir": "../.tshy-build/esm"
|
| 15 |
+
}
|
| 16 |
+
}
|
node_modules/@jimp/js-bmp/CHANGELOG.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# v1.5.0 (Sat Sep 07 2024)
|
| 2 |
+
|
| 3 |
+
### Release Notes
|
| 4 |
+
|
| 5 |
+
#### Add support for image decoder options ([#1336](https://github.com/jimp-dev/jimp/pull/1336))
|
| 6 |
+
|
| 7 |
+
Can now have options for the underlying image codecs
|
| 8 |
+
|
| 9 |
+

|
| 10 |
+
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
#### 🚀 Enhancement
|
| 14 |
+
|
| 15 |
+
- Add support for image decoder options [#1336](https://github.com/jimp-dev/jimp/pull/1336) ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 16 |
+
|
| 17 |
+
#### Authors: 1
|
| 18 |
+
|
| 19 |
+
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 20 |
+
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
# v1.1.3 (Mon Sep 02 2024)
|
| 24 |
+
|
| 25 |
+
#### 🐛 Bug Fix
|
| 26 |
+
|
| 27 |
+
- Update deps [#1319](https://github.com/jimp-dev/jimp/pull/1319) ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 28 |
+
|
| 29 |
+
#### Authors: 1
|
| 30 |
+
|
| 31 |
+
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 32 |
+
|
| 33 |
+
---
|
| 34 |
+
|
| 35 |
+
# v1.1.0 (Sun Sep 01 2024)
|
| 36 |
+
|
| 37 |
+
#### ⚠️ Pushed to `main`
|
| 38 |
+
|
| 39 |
+
- upgrade tshy ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 40 |
+
|
| 41 |
+
#### Authors: 1
|
| 42 |
+
|
| 43 |
+
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 44 |
+
|
| 45 |
+
---
|
| 46 |
+
|
| 47 |
+
# v1.0.3 (Sat Aug 31 2024)
|
| 48 |
+
|
| 49 |
+
#### 🐛 Bug Fix
|
| 50 |
+
|
| 51 |
+
- Fix build [#1303](https://github.com/jimp-dev/jimp/pull/1303) ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 52 |
+
|
| 53 |
+
#### ⚠️ Pushed to `main`
|
| 54 |
+
|
| 55 |
+
- add clean script ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 56 |
+
|
| 57 |
+
#### Authors: 1
|
| 58 |
+
|
| 59 |
+
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 60 |
+
|
| 61 |
+
---
|
| 62 |
+
|
| 63 |
+
# v1.0.2 (Sat Aug 31 2024)
|
| 64 |
+
|
| 65 |
+
#### ⚠️ Pushed to `main`
|
| 66 |
+
|
| 67 |
+
- set side effects ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 68 |
+
- fix versions ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 69 |
+
- add publish config ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
| 70 |
+
|
| 71 |
+
#### Authors: 1
|
| 72 |
+
|
| 73 |
+
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
|
node_modules/@jimp/js-bmp/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2018 Oliver Moran
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
node_modules/@jimp/js-bmp/README.md
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div align="center">
|
| 2 |
+
<img width="200" height="200"
|
| 3 |
+
src="https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-11/256/crayon.png">
|
| 4 |
+
<h1>@jimp/bmp</h1>
|
| 5 |
+
<p>Default Jimp bmp encoder/decoder.</p>
|
| 6 |
+
</div>
|
node_modules/@jimp/js-bmp/dist/commonjs/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as BMP from "bmp-ts";
|
| 2 |
+
import { Bitmap } from "@jimp/types";
|
| 3 |
+
export type { BmpColor } from "bmp-ts";
|
| 4 |
+
export { BmpCompression } from "bmp-ts";
|
| 5 |
+
type Pretty<T> = {
|
| 6 |
+
[K in keyof T]: T[K] extends (...args: any[]) => any ? T[K] : T[K] extends object ? Pretty<T[K]> : T[K];
|
| 7 |
+
};
|
| 8 |
+
export type EncodeOptions = Pretty<Partial<Pick<BMP.BmpImage, "palette" | "colors" | "importantColors" | "hr" | "vr" | "reserved1" | "reserved2">>>;
|
| 9 |
+
export interface DecodeBmpOptions {
|
| 10 |
+
toRGBA?: boolean;
|
| 11 |
+
}
|
| 12 |
+
declare function encode(image: Bitmap, options?: EncodeOptions): Buffer;
|
| 13 |
+
declare function decode(data: Buffer, options?: DecodeBmpOptions): Bitmap;
|
| 14 |
+
export declare function msBmp(): {
|
| 15 |
+
mime: "image/x-ms-bmp";
|
| 16 |
+
encode: typeof encode;
|
| 17 |
+
decode: typeof decode;
|
| 18 |
+
};
|
| 19 |
+
export default function bmp(): {
|
| 20 |
+
mime: "image/bmp";
|
| 21 |
+
encode: typeof encode;
|
| 22 |
+
decode: typeof decode;
|
| 23 |
+
};
|
| 24 |
+
//# sourceMappingURL=index.d.ts.map
|
node_modules/@jimp/js-bmp/dist/commonjs/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,QAAQ,CAAC;AAG9B,OAAO,EAAE,MAAM,EAAU,MAAM,aAAa,CAAC;AAE7C,YAAY,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAExC,KAAK,MAAM,CAAC,CAAC,IAAI;KAEd,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GAChD,CAAC,CAAC,CAAC,CAAC,GACJ,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GACjB,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACZ,CAAC,CAAC,CAAC,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,MAAM,CAChC,OAAO,CACL,IAAI,CACF,GAAG,CAAC,QAAQ,EACV,SAAS,GACT,QAAQ,GACR,iBAAiB,GACjB,IAAI,GACJ,IAAI,GACJ,WAAW,GACX,WAAW,CACd,CACF,CACF,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,iBAAS,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,UAqBzD;AAED,iBAAS,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAsBrC,MAAM,CACxB;AAED,wBAAgB,KAAK;;;;EAMpB;AAED,MAAM,CAAC,OAAO,UAAU,GAAG;;;;EAM1B"}
|
node_modules/@jimp/js-bmp/dist/commonjs/index.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
| 3 |
+
if (k2 === undefined) k2 = k;
|
| 4 |
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
| 5 |
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
| 6 |
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
| 7 |
+
}
|
| 8 |
+
Object.defineProperty(o, k2, desc);
|
| 9 |
+
}) : (function(o, m, k, k2) {
|
| 10 |
+
if (k2 === undefined) k2 = k;
|
| 11 |
+
o[k2] = m[k];
|
| 12 |
+
}));
|
| 13 |
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
| 14 |
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
| 15 |
+
}) : function(o, v) {
|
| 16 |
+
o["default"] = v;
|
| 17 |
+
});
|
| 18 |
+
var __importStar = (this && this.__importStar) || function (mod) {
|
| 19 |
+
if (mod && mod.__esModule) return mod;
|
| 20 |
+
var result = {};
|
| 21 |
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
| 22 |
+
__setModuleDefault(result, mod);
|
| 23 |
+
return result;
|
| 24 |
+
};
|
| 25 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 26 |
+
exports.BmpCompression = void 0;
|
| 27 |
+
exports.msBmp = msBmp;
|
| 28 |
+
exports.default = bmp;
|
| 29 |
+
const BMP = __importStar(require("bmp-ts"));
|
| 30 |
+
const utils_1 = require("@jimp/utils");
|
| 31 |
+
var bmp_ts_1 = require("bmp-ts");
|
| 32 |
+
Object.defineProperty(exports, "BmpCompression", { enumerable: true, get: function () { return bmp_ts_1.BmpCompression; } });
|
| 33 |
+
function encode(image, options = {}) {
|
| 34 |
+
(0, utils_1.scan)({ bitmap: image }, 0, 0, image.width, image.height, function (_, __, index) {
|
| 35 |
+
const red = image.data[index + 0];
|
| 36 |
+
const green = image.data[index + 1];
|
| 37 |
+
const blue = image.data[index + 2];
|
| 38 |
+
const alpha = image.data[index + 3];
|
| 39 |
+
image.data[index + 0] = alpha;
|
| 40 |
+
image.data[index + 1] = blue;
|
| 41 |
+
image.data[index + 2] = green;
|
| 42 |
+
image.data[index + 3] = red;
|
| 43 |
+
});
|
| 44 |
+
return BMP.encode({ ...image, ...options }).data;
|
| 45 |
+
}
|
| 46 |
+
function decode(data, options) {
|
| 47 |
+
const result = BMP.decode(data, options);
|
| 48 |
+
(0, utils_1.scan)({ bitmap: result }, 0, 0, result.width, result.height, function (_, __, index) {
|
| 49 |
+
// const alpha = result.data[index + 0]!;
|
| 50 |
+
const blue = result.data[index + 1];
|
| 51 |
+
const green = result.data[index + 2];
|
| 52 |
+
const red = result.data[index + 3];
|
| 53 |
+
result.data[index + 0] = red;
|
| 54 |
+
result.data[index + 1] = green;
|
| 55 |
+
result.data[index + 2] = blue;
|
| 56 |
+
result.data[index + 3] = 0xff;
|
| 57 |
+
});
|
| 58 |
+
return result;
|
| 59 |
+
}
|
| 60 |
+
function msBmp() {
|
| 61 |
+
return {
|
| 62 |
+
mime: "image/x-ms-bmp",
|
| 63 |
+
encode,
|
| 64 |
+
decode,
|
| 65 |
+
};
|
| 66 |
+
}
|
| 67 |
+
function bmp() {
|
| 68 |
+
return {
|
| 69 |
+
mime: "image/bmp",
|
| 70 |
+
encode,
|
| 71 |
+
decode,
|
| 72 |
+
};
|
| 73 |
+
}
|
| 74 |
+
//# sourceMappingURL=index.js.map
|
node_modules/@jimp/js-bmp/dist/commonjs/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAoFA,sBAMC;AAED,sBAMC;AAlGD,4CAA8B;AAE9B,uCAAmC;AAInC,iCAAwC;AAA/B,wGAAA,cAAc,OAAA;AA8BvB,SAAS,MAAM,CAAC,KAAa,EAAE,UAAyB,EAAE;IACxD,IAAA,YAAI,EACF,EAAE,MAAM,EAAE,KAAK,EAAE,EACjB,CAAC,EACD,CAAC,EACD,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,MAAM,EACZ,UAAU,CAAC,EAAE,EAAE,EAAE,KAAK;QACpB,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAE,CAAC;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAE,CAAC;QACrC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAE,CAAC;QACpC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAE,CAAC;QAErC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;IAC9B,CAAC,CACF,CAAC;IAEF,OAAO,GAAG,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC;AACnD,CAAC;AAED,SAAS,MAAM,CAAC,IAAY,EAAE,OAA0B;IACtD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAEzC,IAAA,YAAI,EACF,EAAE,MAAM,EAAE,MAAM,EAAE,EAClB,CAAC,EACD,CAAC,EACD,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,MAAM,EACb,UAAU,CAAC,EAAE,EAAE,EAAE,KAAK;QACpB,yCAAyC;QACzC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAE,CAAC;QACrC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAE,CAAC;QACtC,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAE,CAAC;QAEpC,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;QAC7B,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QAC/B,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;QAC9B,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;IAChC,CAAC,CACF,CAAC;IAEF,OAAO,MAAgB,CAAC;AAC1B,CAAC;AAED,SAAgB,KAAK;IACnB,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,MAAM;QACN,MAAM;KAC4B,CAAC;AACvC,CAAC;AAED,SAAwB,GAAG;IACzB,OAAO;QACL,IAAI,EAAE,WAAW;QACjB,MAAM;QACN,MAAM;KACuB,CAAC;AAClC,CAAC"}
|
node_modules/@jimp/js-bmp/dist/commonjs/package.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"type": "commonjs"
|
| 3 |
+
}
|
node_modules/@jimp/js-bmp/dist/esm/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as BMP from "bmp-ts";
|
| 2 |
+
import { Bitmap } from "@jimp/types";
|
| 3 |
+
export type { BmpColor } from "bmp-ts";
|
| 4 |
+
export { BmpCompression } from "bmp-ts";
|
| 5 |
+
type Pretty<T> = {
|
| 6 |
+
[K in keyof T]: T[K] extends (...args: any[]) => any ? T[K] : T[K] extends object ? Pretty<T[K]> : T[K];
|
| 7 |
+
};
|
| 8 |
+
export type EncodeOptions = Pretty<Partial<Pick<BMP.BmpImage, "palette" | "colors" | "importantColors" | "hr" | "vr" | "reserved1" | "reserved2">>>;
|
| 9 |
+
export interface DecodeBmpOptions {
|
| 10 |
+
toRGBA?: boolean;
|
| 11 |
+
}
|
| 12 |
+
declare function encode(image: Bitmap, options?: EncodeOptions): Buffer;
|
| 13 |
+
declare function decode(data: Buffer, options?: DecodeBmpOptions): Bitmap;
|
| 14 |
+
export declare function msBmp(): {
|
| 15 |
+
mime: "image/x-ms-bmp";
|
| 16 |
+
encode: typeof encode;
|
| 17 |
+
decode: typeof decode;
|
| 18 |
+
};
|
| 19 |
+
export default function bmp(): {
|
| 20 |
+
mime: "image/bmp";
|
| 21 |
+
encode: typeof encode;
|
| 22 |
+
decode: typeof decode;
|
| 23 |
+
};
|
| 24 |
+
//# sourceMappingURL=index.d.ts.map
|
node_modules/@jimp/js-bmp/dist/esm/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,QAAQ,CAAC;AAG9B,OAAO,EAAE,MAAM,EAAU,MAAM,aAAa,CAAC;AAE7C,YAAY,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAExC,KAAK,MAAM,CAAC,CAAC,IAAI;KAEd,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GAChD,CAAC,CAAC,CAAC,CAAC,GACJ,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GACjB,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACZ,CAAC,CAAC,CAAC,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,MAAM,CAChC,OAAO,CACL,IAAI,CACF,GAAG,CAAC,QAAQ,EACV,SAAS,GACT,QAAQ,GACR,iBAAiB,GACjB,IAAI,GACJ,IAAI,GACJ,WAAW,GACX,WAAW,CACd,CACF,CACF,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,iBAAS,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,UAqBzD;AAED,iBAAS,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAsBrC,MAAM,CACxB;AAED,wBAAgB,KAAK;;;;EAMpB;AAED,MAAM,CAAC,OAAO,UAAU,GAAG;;;;EAM1B"}
|
node_modules/@jimp/js-bmp/dist/esm/index.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as BMP from "bmp-ts";
|
| 2 |
+
import { scan } from "@jimp/utils";
|
| 3 |
+
export { BmpCompression } from "bmp-ts";
|
| 4 |
+
function encode(image, options = {}) {
|
| 5 |
+
scan({ bitmap: image }, 0, 0, image.width, image.height, function (_, __, index) {
|
| 6 |
+
const red = image.data[index + 0];
|
| 7 |
+
const green = image.data[index + 1];
|
| 8 |
+
const blue = image.data[index + 2];
|
| 9 |
+
const alpha = image.data[index + 3];
|
| 10 |
+
image.data[index + 0] = alpha;
|
| 11 |
+
image.data[index + 1] = blue;
|
| 12 |
+
image.data[index + 2] = green;
|
| 13 |
+
image.data[index + 3] = red;
|
| 14 |
+
});
|
| 15 |
+
return BMP.encode({ ...image, ...options }).data;
|
| 16 |
+
}
|
| 17 |
+
function decode(data, options) {
|
| 18 |
+
const result = BMP.decode(data, options);
|
| 19 |
+
scan({ bitmap: result }, 0, 0, result.width, result.height, function (_, __, index) {
|
| 20 |
+
// const alpha = result.data[index + 0]!;
|
| 21 |
+
const blue = result.data[index + 1];
|
| 22 |
+
const green = result.data[index + 2];
|
| 23 |
+
const red = result.data[index + 3];
|
| 24 |
+
result.data[index + 0] = red;
|
| 25 |
+
result.data[index + 1] = green;
|
| 26 |
+
result.data[index + 2] = blue;
|
| 27 |
+
result.data[index + 3] = 0xff;
|
| 28 |
+
});
|
| 29 |
+
return result;
|
| 30 |
+
}
|
| 31 |
+
export function msBmp() {
|
| 32 |
+
return {
|
| 33 |
+
mime: "image/x-ms-bmp",
|
| 34 |
+
encode,
|
| 35 |
+
decode,
|
| 36 |
+
};
|
| 37 |
+
}
|
| 38 |
+
export default function bmp() {
|
| 39 |
+
return {
|
| 40 |
+
mime: "image/bmp",
|
| 41 |
+
encode,
|
| 42 |
+
decode,
|
| 43 |
+
};
|
| 44 |
+
}
|
| 45 |
+
//# sourceMappingURL=index.js.map
|
node_modules/@jimp/js-bmp/dist/esm/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,QAAQ,CAAC;AAE9B,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAInC,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AA8BxC,SAAS,MAAM,CAAC,KAAa,EAAE,UAAyB,EAAE;IACxD,IAAI,CACF,EAAE,MAAM,EAAE,KAAK,EAAE,EACjB,CAAC,EACD,CAAC,EACD,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,MAAM,EACZ,UAAU,CAAC,EAAE,EAAE,EAAE,KAAK;QACpB,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAE,CAAC;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAE,CAAC;QACrC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAE,CAAC;QACpC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAE,CAAC;QAErC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;IAC9B,CAAC,CACF,CAAC;IAEF,OAAO,GAAG,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC;AACnD,CAAC;AAED,SAAS,MAAM,CAAC,IAAY,EAAE,OAA0B;IACtD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAEzC,IAAI,CACF,EAAE,MAAM,EAAE,MAAM,EAAE,EAClB,CAAC,EACD,CAAC,EACD,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,MAAM,EACb,UAAU,CAAC,EAAE,EAAE,EAAE,KAAK;QACpB,yCAAyC;QACzC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAE,CAAC;QACrC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAE,CAAC;QACtC,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAE,CAAC;QAEpC,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;QAC7B,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QAC/B,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;QAC9B,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;IAChC,CAAC,CACF,CAAC;IAEF,OAAO,MAAgB,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,KAAK;IACnB,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,MAAM;QACN,MAAM;KAC4B,CAAC;AACvC,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,GAAG;IACzB,OAAO;QACL,IAAI,EAAE,WAAW;QACjB,MAAM;QACN,MAAM;KACuB,CAAC;AAClC,CAAC"}
|
node_modules/@jimp/js-bmp/dist/esm/package.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"type": "module"
|
| 3 |
+
}
|
node_modules/@jimp/js-bmp/eslint.config.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import shared from "@jimp/config-eslint/base.js";
|
| 2 |
+
export default [...shared];
|
node_modules/@jimp/js-bmp/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@jimp/js-bmp",
|
| 3 |
+
"version": "1.6.1",
|
| 4 |
+
"repository": "jimp-dev/jimp",
|
| 5 |
+
"engines": {
|
| 6 |
+
"node": ">=18"
|
| 7 |
+
},
|
| 8 |
+
"scripts": {
|
| 9 |
+
"lint": "eslint .",
|
| 10 |
+
"test": "vitest",
|
| 11 |
+
"test:browser": "vitest --config vitest.config.browser.mjs",
|
| 12 |
+
"build": "tshy",
|
| 13 |
+
"dev": "tshy --watch",
|
| 14 |
+
"clean": "rm -rf node_modules .tshy .tshy-build dist .turbo"
|
| 15 |
+
},
|
| 16 |
+
"author": "Andrew Lisowski <lisowski54@gmail.com>",
|
| 17 |
+
"license": "MIT",
|
| 18 |
+
"devDependencies": {
|
| 19 |
+
"@jimp/config-eslint": "1.6.1",
|
| 20 |
+
"@jimp/config-typescript": "1.6.1",
|
| 21 |
+
"@jimp/config-vitest": "1.6.1",
|
| 22 |
+
"@jimp/js-png": "1.6.1",
|
| 23 |
+
"@jimp/test-utils": "1.6.1",
|
| 24 |
+
"@types/node": "^18.19.48",
|
| 25 |
+
"@vitest/browser": "^2.0.5",
|
| 26 |
+
"eslint": "^9.9.1",
|
| 27 |
+
"tshy": "^3.0.2",
|
| 28 |
+
"typescript": "^5.5.4",
|
| 29 |
+
"vite-plugin-node-polyfills": "^0.22.0",
|
| 30 |
+
"vitest": "^2.0.5"
|
| 31 |
+
},
|
| 32 |
+
"tshy": {
|
| 33 |
+
"exclude": [
|
| 34 |
+
"**/*.test.ts"
|
| 35 |
+
],
|
| 36 |
+
"exports": {
|
| 37 |
+
"./package.json": "./package.json",
|
| 38 |
+
".": "./src/index.ts"
|
| 39 |
+
}
|
| 40 |
+
},
|
| 41 |
+
"exports": {
|
| 42 |
+
"./package.json": "./package.json",
|
| 43 |
+
".": {
|
| 44 |
+
"import": {
|
| 45 |
+
"types": "./dist/esm/index.d.ts",
|
| 46 |
+
"default": "./dist/esm/index.js"
|
| 47 |
+
},
|
| 48 |
+
"require": {
|
| 49 |
+
"types": "./dist/commonjs/index.d.ts",
|
| 50 |
+
"default": "./dist/commonjs/index.js"
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
},
|
| 54 |
+
"main": "./dist/commonjs/index.js",
|
| 55 |
+
"types": "./dist/commonjs/index.d.ts",
|
| 56 |
+
"type": "module",
|
| 57 |
+
"dependencies": {
|
| 58 |
+
"@jimp/core": "1.6.1",
|
| 59 |
+
"@jimp/types": "1.6.1",
|
| 60 |
+
"@jimp/utils": "1.6.1",
|
| 61 |
+
"bmp-ts": "^1.0.9"
|
| 62 |
+
},
|
| 63 |
+
"publishConfig": {
|
| 64 |
+
"access": "public"
|
| 65 |
+
},
|
| 66 |
+
"sideEffects": false,
|
| 67 |
+
"module": "./dist/esm/index.js",
|
| 68 |
+
"gitHead": "7e6a95694e00a8b6f1bdd9aad709f5413eb9b08c"
|
| 69 |
+
}
|
node_modules/@jimp/js-bmp/src/images/windows95.bmp
ADDED
|
Git LFS Details
|
node_modules/@jimp/js-bmp/src/images/windows95.png
ADDED
|
node_modules/@jimp/js-bmp/src/index.node.test.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { describe, expect, test } from "vitest";
|
| 2 |
+
import { createJimp } from "@jimp/core";
|
| 3 |
+
import { getTestImagePath } from "@jimp/test-utils";
|
| 4 |
+
|
| 5 |
+
import png from "@jimp/js-png";
|
| 6 |
+
import bmp from "./index.js";
|
| 7 |
+
|
| 8 |
+
const jimp = createJimp({ formats: [bmp, png] });
|
| 9 |
+
|
| 10 |
+
describe("BMP", () => {
|
| 11 |
+
test("uses correct colors for BMP", async function () {
|
| 12 |
+
const expectedImg = await jimp.read(getTestImagePath("windows95.png"));
|
| 13 |
+
const image = await jimp.read(getTestImagePath("windows95.bmp"));
|
| 14 |
+
|
| 15 |
+
expect(image.bitmap.data).toEqual(expectedImg.bitmap.data);
|
| 16 |
+
});
|
| 17 |
+
});
|
node_modules/@jimp/js-bmp/src/index.test.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { describe, expect, test } from "vitest";
|
| 2 |
+
import { createJimp } from "@jimp/core";
|
| 3 |
+
import { getTestImagePath } from "@jimp/test-utils";
|
| 4 |
+
|
| 5 |
+
import png from "@jimp/js-png";
|
| 6 |
+
import bmp from "./index.js";
|
| 7 |
+
|
| 8 |
+
const jimp = createJimp({ formats: [bmp, png] });
|
| 9 |
+
|
| 10 |
+
describe("BMP", () => {
|
| 11 |
+
test("load BMP", async () => {
|
| 12 |
+
const image = await jimp.read(getTestImagePath("windows95.bmp"));
|
| 13 |
+
|
| 14 |
+
expect(image.getPixelColor(10, 10)).toBe(0xeff7f7ff);
|
| 15 |
+
expect(image.getPixelColor(150, 80)).toBe(0x73add6ff);
|
| 16 |
+
expect(image.getPixelColor(190, 200)).toBe(0xf7c300ff);
|
| 17 |
+
});
|
| 18 |
+
|
| 19 |
+
test("export BMP", async () => {
|
| 20 |
+
const image = jimp.fromBitmap({
|
| 21 |
+
width: 3,
|
| 22 |
+
height: 3,
|
| 23 |
+
data: [
|
| 24 |
+
0xff0000ff, 0xff0080ff, 0xff00ffff, 0xff0080ff, 0xff00ffff, 0x8000ffff,
|
| 25 |
+
0xff00ffff, 0x8000ffff, 0x0000ffff,
|
| 26 |
+
],
|
| 27 |
+
});
|
| 28 |
+
const buffer = await image.getBuffer("image/bmp");
|
| 29 |
+
|
| 30 |
+
expect(buffer.toString()).toMatch(/^BM/);
|
| 31 |
+
});
|
| 32 |
+
});
|
node_modules/@jimp/js-bmp/src/index.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as BMP from "bmp-ts";
|
| 2 |
+
|
| 3 |
+
import { scan } from "@jimp/utils";
|
| 4 |
+
import { Bitmap, Format } from "@jimp/types";
|
| 5 |
+
|
| 6 |
+
export type { BmpColor } from "bmp-ts";
|
| 7 |
+
export { BmpCompression } from "bmp-ts";
|
| 8 |
+
|
| 9 |
+
type Pretty<T> = {
|
| 10 |
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 11 |
+
[K in keyof T]: T[K] extends (...args: any[]) => any
|
| 12 |
+
? T[K]
|
| 13 |
+
: T[K] extends object
|
| 14 |
+
? Pretty<T[K]>
|
| 15 |
+
: T[K];
|
| 16 |
+
};
|
| 17 |
+
|
| 18 |
+
export type EncodeOptions = Pretty<
|
| 19 |
+
Partial<
|
| 20 |
+
Pick<
|
| 21 |
+
BMP.BmpImage,
|
| 22 |
+
| "palette"
|
| 23 |
+
| "colors"
|
| 24 |
+
| "importantColors"
|
| 25 |
+
| "hr"
|
| 26 |
+
| "vr"
|
| 27 |
+
| "reserved1"
|
| 28 |
+
| "reserved2"
|
| 29 |
+
>
|
| 30 |
+
>
|
| 31 |
+
>;
|
| 32 |
+
|
| 33 |
+
export interface DecodeBmpOptions {
|
| 34 |
+
toRGBA?: boolean;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
function encode(image: Bitmap, options: EncodeOptions = {}) {
|
| 38 |
+
scan(
|
| 39 |
+
{ bitmap: image },
|
| 40 |
+
0,
|
| 41 |
+
0,
|
| 42 |
+
image.width,
|
| 43 |
+
image.height,
|
| 44 |
+
function (_, __, index) {
|
| 45 |
+
const red = image.data[index + 0]!;
|
| 46 |
+
const green = image.data[index + 1]!;
|
| 47 |
+
const blue = image.data[index + 2]!;
|
| 48 |
+
const alpha = image.data[index + 3]!;
|
| 49 |
+
|
| 50 |
+
image.data[index + 0] = alpha;
|
| 51 |
+
image.data[index + 1] = blue;
|
| 52 |
+
image.data[index + 2] = green;
|
| 53 |
+
image.data[index + 3] = red;
|
| 54 |
+
}
|
| 55 |
+
);
|
| 56 |
+
|
| 57 |
+
return BMP.encode({ ...image, ...options }).data;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
function decode(data: Buffer, options?: DecodeBmpOptions) {
|
| 61 |
+
const result = BMP.decode(data, options);
|
| 62 |
+
|
| 63 |
+
scan(
|
| 64 |
+
{ bitmap: result },
|
| 65 |
+
0,
|
| 66 |
+
0,
|
| 67 |
+
result.width,
|
| 68 |
+
result.height,
|
| 69 |
+
function (_, __, index) {
|
| 70 |
+
// const alpha = result.data[index + 0]!;
|
| 71 |
+
const blue = result.data[index + 1]!;
|
| 72 |
+
const green = result.data[index + 2]!;
|
| 73 |
+
const red = result.data[index + 3]!;
|
| 74 |
+
|
| 75 |
+
result.data[index + 0] = red;
|
| 76 |
+
result.data[index + 1] = green;
|
| 77 |
+
result.data[index + 2] = blue;
|
| 78 |
+
result.data[index + 3] = 0xff;
|
| 79 |
+
}
|
| 80 |
+
);
|
| 81 |
+
|
| 82 |
+
return result as Bitmap;
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
export function msBmp() {
|
| 86 |
+
return {
|
| 87 |
+
mime: "image/x-ms-bmp",
|
| 88 |
+
encode,
|
| 89 |
+
decode,
|
| 90 |
+
} satisfies Format<"image/x-ms-bmp">;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
export default function bmp() {
|
| 94 |
+
return {
|
| 95 |
+
mime: "image/bmp",
|
| 96 |
+
encode,
|
| 97 |
+
decode,
|
| 98 |
+
} satisfies Format<"image/bmp">;
|
| 99 |
+
}
|