Initial commit

This commit is contained in:
robert committed 2025-05-30 18:13:30 +08:00
commit e49726988c
5445 files changed
+1089914

No files matched your search

Generated Vendored
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 Oliver Moran
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+41
View File
@@ -0,0 +1,41 @@
<div align="center">
<img width="200" height="200"
src="https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-11/256/crayon.png">
<h1>Jimp</h1>
<p>JavaScript Image Manipulation Program</p>
</div>
The "JavaScript Image Manipulation Program" :-)
An image processing library for Node written entirely in JavaScript, with zero native dependencies.
The default jimp configuration.
Supported types:
- `@jimp/jpeg`
- `@jimp/png`
- `@jimp/bmp`
- `@jimp/tiff`
- `@jimp/gif`
[Read the full docs.](http://jimp-dev.github.io/jimp/)
## Installation
```bash
npm install --save jimp
```
## Usage
```js
const { Jimp } = require("jimp");
// open a file called "lenna.png"
const image = await Jimp.read("test.png");
image.resize(256, 256); // resize
await image.write("test-small.jpg"); // save
```
+5
View File
@@ -0,0 +1,5 @@
/**
* @module jimp/fonts
*/
export * from "@jimp/plugin-print/fonts";
//# sourceMappingURL=fonts.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../src/fonts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,0BAA0B,CAAC"}
+5
View File
@@ -0,0 +1,5 @@
/**
* @module jimp/fonts
*/
export * from "@jimp/plugin-print/fonts";
//# sourceMappingURL=fonts.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"fonts.js","sourceRoot":"","sources":["../../src/fonts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,0BAA0B,CAAC"}
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index-browser.d.mts","sourceRoot":"","sources":["../../src/index-browser.mts"],"names":[],"mappings":""}
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index-browser.mjs","sourceRoot":"","sources":["../../src/index-browser.mts"],"names":[],"mappings":";AAAA,4CAA4C"}
+1764
View File
File diff suppressed because it is too large. Load diff
+236
View File
@@ -0,0 +1,236 @@
var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function getAugmentedNamespace(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var i=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),i}"undefined"==typeof self&&"object"==typeof commonjsGlobal&&(commonjsGlobal.self=commonjsGlobal);var global$1="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,inited=!1;function init(){inited=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)lookup[t]=e[t],revLookup[e.charCodeAt(t)]=t;revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63}function toByteArray(e){var t,i,r,n,a,o;inited||init();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===e[s-2]?2:"="===e[s-1]?1:0,o=new Arr(3*s/4-a),r=a>0?s-4:s;var l=0;for(t=0,i=0;t<r;t+=4,i+=3)n=revLookup[e.charCodeAt(t)]<<18|revLookup[e.charCodeAt(t+1)]<<12|revLookup[e.charCodeAt(t+2)]<<6|revLookup[e.charCodeAt(t+3)],o[l++]=n>>16&255,o[l++]=n>>8&255,o[l++]=255&n;return 2===a?(n=revLookup[e.charCodeAt(t)]<<2|revLookup[e.charCodeAt(t+1)]>>4,o[l++]=255&n):1===a&&(n=revLookup[e.charCodeAt(t)]<<10|revLookup[e.charCodeAt(t+1)]<<4|revLookup[e.charCodeAt(t+2)]>>2,o[l++]=n>>8&255,o[l++]=255&n),o}function tripletToBase64(e){return lookup[e>>18&63]+lookup[e>>12&63]+lookup[e>>6&63]+lookup[63&e]}function encodeChunk(e,t,i){for(var r,n=[],a=t;a<i;a+=3)r=(e[a]<<16)+(e[a+1]<<8)+e[a+2],n.push(tripletToBase64(r));return n.join("")}function fromByteArray(e){var t;inited||init();for(var i=e.length,r=i%3,n="",a=[],o=16383,s=0,l=i-r;s<l;s+=o)a.push(encodeChunk(e,s,s+o>l?l:s+o));return 1===r?(t=e[i-1],n+=lookup[t>>2],n+=lookup[t<<4&63],n+="=="):2===r&&(t=(e[i-2]<<8)+e[i-1],n+=lookup[t>>10],n+=lookup[t>>4&63],n+=lookup[t<<2&63],n+="="),a.push(n),a.join("")}function read(e,t,i,r,n){var a,o,s=8*n-r-1,l=(1<<s)-1,u=l>>1,h=-7,c=i?n-1:0,f=i?-1:1,d=e[t+c];for(c+=f,a=d&(1<<-h)-1,d>>=-h,h+=s;h>0;a=256*a+e[t+c],c+=f,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=r;h>0;o=256*o+e[t+c],c+=f,h-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,r),a-=u}return(d?-1:1)*o*Math.pow(2,a-r)}function write(e,t,i,r,n,a){var o,s,l,u=8*a-n-1,h=(1<<u)-1,c=h>>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+c>=1?f/l:f*Math.pow(2,1-c))*l>=2&&(o++,l/=2),o+c>=h?(s=0,o=h):o+c>=1?(s=(t*l-1)*Math.pow(2,n),o+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;e[i+d]=255&s,d+=p,s/=256,n-=8);for(o=o<<n|s,u+=n;u>0;e[i+d]=255&o,d+=p,o/=256,u-=8);e[i+d-p]|=128*m}var toString={}.toString,isArray=Array.isArray||function(e){return"[object Array]"==toString.call(e)},INSPECT_MAX_BYTES=50;function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,t){if(kMaxLength()<t)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Buffer.prototype:(null===e&&(e=new Buffer(t)),e.length=t),e}function Buffer(e,t,i){if(!(Buffer.TYPED_ARRAY_SUPPORT||this instanceof Buffer))return new Buffer(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,e)}return from(this,e,t,i)}function from(e,t,i,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?fromArrayBuffer(e,t,i,r):"string"==typeof t?fromString(e,t,i):fromObject(e,t)}function assertSize(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function alloc(e,t,i,r){return assertSize(t),t<=0?createBuffer(e,t):void 0!==i?"string"==typeof r?createBuffer(e,t).fill(i,r):createBuffer(e,t).fill(i):createBuffer(e,t)}function allocUnsafe(e,t){if(assertSize(t),e=createBuffer(e,t<0?0:0|checked(t)),!Buffer.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function fromString(e,t,i){if("string"==typeof i&&""!==i||(i="utf8"),!Buffer.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var r=0|byteLength(t,i),n=(e=createBuffer(e,r)).write(t,i);returnLine truncated
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/function n(e,t){if(e===t)return 0;for(var i=e.length,r=t.length,n=0,a=Math.min(i,r);n<a;++n)if(e[n]!==t[n]){i=e[n],r=t[n];break}return i<r?-1:r<i?1:0}function a(e){return i.Buffer&&"function"==typeof i.Buffer.isBuffer?i.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var o=e("util/"),s=Object.prototype.hasOwnProperty,l=Array.prototype.slice,u="foo"===function(){}.name;function h(e){return Object.prototype.toString.call(e)}function c(e){return!a(e)&&"function"==typeof i.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer)))}var f=t.exports=y,d=/\s*function\s+([^\(\s]*)\s*/;function p(e){if(o.isFunction(e)){if(u)return e.name;var t=e.toString().match(d);return t&&t[1]}}function m(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function _(e){if(u||!o.isFunction(e))return o.inspect(e);var t=p(e);return"[Function"+(t?": "+t:"")+"]"}function g(e){return m(_(e.actual),128)+" "+e.operator+" "+m(_(e.expected),128)}function b(e,t,i,r,n){throw new f.AssertionError({message:i,actual:e,expected:t,operator:r,stackStartFunction:n})}function y(e,t){e||b(e,!0,t,"==",f.ok)}function w(e,t,i,r){if(e===t)return!0;if(a(e)&&a(t))return 0===n(e,t);if(o.isDate(e)&&o.isDate(t))return e.getTime()===t.getTime();if(o.isRegExp(e)&&o.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(c(e)&&c(t)&&h(e)===h(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===n(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(a(e)!==a(t))return!1;var s=(r=r||{actual:[],expected:[]}).actual.indexOf(e);return-1!==s&&s===r.expected.indexOf(t)||(r.actual.push(e),r.expected.push(t),x(e,t,i,r))}return i?e===t:e==t}function v(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function x(e,t,i,r){if(null==e||null==t)return!1;if(o.isPrimitive(e)||o.isPrimitive(t))return e===t;if(i&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var n=v(e),a=v(t);if(n&&!a||!n&&a)return!1;if(n)return w(e=l.call(e),t=l.call(t),i);var s,u,h=M(e),c=M(t);if(h.length!==c.length)return!1;for(h.sort(),c.sort(),u=h.length-1;u>=0;u--)if(h[u]!==c[u])return!1;for(u=h.length-1;u>=0;u--)if(!w(e[s=h[u]],t[s],i,r))return!1;return!0}function E(e,t,i){w(e,t,!0)&&b(e,t,i,"notDeepStrictEqual",E)}function k(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function S(e){var t;try{e()}catch(e){t=e}return t}function A(e,t,i,r){var n;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof i&&(r=i,i=null),n=S(t),r=(i&&i.name?" ("+i.name+").":".")+(r?" "+r:"."),e&&!n&&b(n,i,"Missing expected exception"+r);var a="string"==typeof r,s=!e&&n&&!i;if((!e&&o.isError(n)&&a&&k(n,i)||s)&&b(n,i,"Got unwanted exception"+r),e&&n&&i&&!k(n,i)||!e&&n)throw n}function I(e,t){e||b(e,!0,t,"==",I)}f.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=g(this),this.generatedMessage=!0);var t=e.stackStartFunction||b;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var i=new Error;if(i.stack){var r=i.stack,n=p(t),a=r.indexOf("\n"+n);if(a>=0){var o=r.indexOf("\n",a+1);r=r.substring(o+1)}this.stack=r}}},o.inherits(f.AssertionError,Error),f.fail=b,f.ok=y,f.equal=function(e,t,i){e!=t&&b(e,t,i,"==",f.equal)},f.notEqual=function(e,t,i){e==t&&b(e,t,i,"!=",f.notEqual)},f.deepEqual=function(e,t,i){w(e,t,!1)||b(e,t,i,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(e,t,i){w(e,t,!0)||b(e,t,i,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(e,t,i){w(e,t,!1)&&b(e,t,i,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=E,f.strictEqual=function(e,t,i){e!==t&&b(e,t,i,"===",f.strictEqual)},f.notStrictEqual=function(e,t,i){e===t&&b(e,t,i,"!==",f.notStrictEqual)},f.throws=function(e,t,i){A(!0,e,t,i)},f.doesNotThrow=function(e,t,i){A(!1,e,t,i)},f.ifError=function(e){if(e)throw e},f.strict=r(I,f,{equal:f.strictEqual,deepEqual:f.deepStrictEqual,notEqual:f.notStrictEqual,notDeepEqual:f.notDeepStrictEqual}),f.strict.strict=f.strict;var M=Object.keys||function(e){var t=[];for(var i in e)s.call(e,i)&&t.push(i);return t}}).call(this)}).call(this,void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":51,"util/":26}],24:[function(e,t,i){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}Line truncated
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
i.read=function(e,t,i,r,n){var a,o,s=8*n-r-1,l=(1<<s)-1,u=l>>1,h=-7,c=i?n-1:0,f=i?-1:1,d=e[t+c];for(c+=f,a=d&(1<<-h)-1,d>>=-h,h+=s;h>0;a=256*a+e[t+c],c+=f,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=r;h>0;o=256*o+e[t+c],c+=f,h-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,r),a-=u}return(d?-1:1)*o*Math.pow(2,a-r)},i.write=function(e,t,i,r,n,a){var o,s,l,u=8*a-n-1,h=(1<<u)-1,c=h>>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+c>=1?f/l:f*Math.pow(2,1-c))*l>=2&&(o++,l/=2),o+c>=h?(s=0,o=h):o+c>=1?(s=(t*l-1)*Math.pow(2,n),o+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;e[i+d]=255&s,d+=p,s/=256,n-=8);for(o=o<<n|s,u+=n;u>0;e[i+d]=255&o,d+=p,o/=256,u-=8);e[i+d-p]|=128*m}},{}],46:[function(e,t,i){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}},{}],47:[function(e,t,i){var r=e("has-tostringtag/shams")(),n=e("call-bind/callBound")("Object.prototype.toString"),a=function(e){return!(r&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===n(e)},o=function(e){return!!a(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==n(e)&&"[object Function]"===n(e.callee)},s=function(){return a(arguments)}();a.isLegacyArguments=o,t.exports=s?a:o},{"call-bind/callBound":33,"has-tostringtag/shams":43}],48:[function(e,t,i){var r,n,a=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},o((function(){throw 42}),null,r)}catch(e){e!==n&&(o=null)}else o=null;var s=/^\s*class\b/,l=function(e){try{var t=a.call(e);return s.test(t)}catch(e){return!1}},u=function(e){try{return!l(e)&&(a.call(e),!0)}catch(e){return!1}},h=Object.prototype.toString,c="[object Object]",f="[object Function]",d="[object GeneratorFunction]",p="[object HTMLAllCollection]",m="[object HTML document.all class]",_="[object HTMLCollection]",g="function"==typeof Symbol&&!!Symbol.toStringTag,b=!(0 in[,]),y=function(){return!1};if("object"==typeof document){var w=document.all;h.call(w)===h.call(document.all)&&(y=function(e){if((b||!e)&&(void 0===e||"object"==typeof e))try{var t=h.call(e);return(t===p||t===m||t===_||t===c)&&null==e("")}catch(e){}return!1})}t.exports=o?function(e){if(y(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{o(e,null,r)}catch(e){if(e!==n)return!1}return!l(e)&&u(e)}:function(e){if(y(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(g)return u(e);if(l(e))return!1;var t=h.call(e);return!(t!==f&&t!==d&&!/^\[object HTML/.test(t))&&u(e)}},{}],49:[function(e,t,i){var r,n=Object.prototype.toString,a=Function.prototype.toString,o=/^\s*(?:function)?\*/,s=e("has-tostringtag/shams")(),l=Object.getPrototypeOf,u=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}};t.exports=function(e){if("function"!=typeof e)return!1;if(o.test(a.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===n.call(e);if(!l)return!1;if(void 0===r){var t=u();r=!!t&&l(t)}return l(e)===r}},{"has-tostringtag/shams":43}],50:[function(e,t,i){(function(i){(function(){var r=e("for-each"),n=e("available-typed-arrays"),a=e("call-bind/callBound"),o=a("Object.prototype.toString"),s=e("has-tostringtag/shams")(),l=e("gopd"),u="undefined"==typeof globalThis?i:globalThis,h=n(),c=a("Array.prototype.indexOf",!0)||function(e,t){for(var i=0;i<e.length;i+=1)if(e[i]===t)return i;return-1},f=a("String.prototype.slice"),d={},p=Object.getPrototypeOf;s&&l&&p&&r(h,(function(e){var t=new u[e];if(Symbol.toStringTag in t){var i=p(t),r=l(i,Symbol.toStringTag);if(!r){var n=p(i);r=l(n,Symbol.toStringTag)}d[e]=r.get}}));var m=function(e){var t=!1;return r(d,(function(i,r){if(!t)try{t=i.call(e)===r}catch(e){}})),t};t.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!s||!(Symbol.toStringTag in e)){var t=f(o(e),8,-1);return c(h,t)>-1}return!!l&&m(e)}}).call(this)}).call(this,void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"available-typed-arrays":27,"call-bind/callBound":33,"for-each":36,gopd:40,"has-tostringtag/shams":43}],51:[function(e,t,i){var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function s(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0]Line truncated
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var r=e("buffer"),n=r.Buffer;function a(e,t){for(var i in e)t[i]=e[i]}function o(e,t,i){return n(e,t,i)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(a(r,i),i.Buffer=o),o.prototype=Object.create(n.prototype),a(n,o),o.from=function(e,t,i){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,i)},o.alloc=function(e,t,i){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=n(e);return void 0!==t?"string"==typeof i?r.fill(t,i):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},{buffer:32}],65:[function(e,t,i){t.exports=n;var r=e("events").EventEmitter;function n(){r.call(this)}e("inherits")(n,r),n.Readable=e("readable-stream/lib/_stream_readable.js"),n.Writable=e("readable-stream/lib/_stream_writable.js"),n.Duplex=e("readable-stream/lib/_stream_duplex.js"),n.Transform=e("readable-stream/lib/_stream_transform.js"),n.PassThrough=e("readable-stream/lib/_stream_passthrough.js"),n.finished=e("readable-stream/lib/internal/streams/end-of-stream.js"),n.pipeline=e("readable-stream/lib/internal/streams/pipeline.js"),n.Stream=n,n.prototype.pipe=function(e,t){var i=this;function n(t){e.writable&&!1===e.write(t)&&i.pause&&i.pause()}function a(){i.readable&&i.resume&&i.resume()}i.on("data",n),e.on("drain",a),e._isStdio||t&&!1===t.end||(i.on("end",s),i.on("close",l));var o=!1;function s(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(h(),0===r.listenerCount(this,"error"))throw e}function h(){i.removeListener("data",n),e.removeListener("drain",a),i.removeListener("end",s),i.removeListener("close",l),i.removeListener("error",u),e.removeListener("error",u),i.removeListener("end",h),i.removeListener("close",h),e.removeListener("close",h)}return i.on("error",u),e.on("error",u),i.on("end",h),i.on("close",h),e.on("close",h),e.emit("pipe",i),e}},{events:35,inherits:46,"readable-stream/lib/_stream_duplex.js":67,"readable-stream/lib/_stream_passthrough.js":68,"readable-stream/lib/_stream_readable.js":69,"readable-stream/lib/_stream_transform.js":70,"readable-stream/lib/_stream_writable.js":71,"readable-stream/lib/internal/streams/end-of-stream.js":75,"readable-stream/lib/internal/streams/pipeline.js":77}],66:[function(e,t,i){function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var n={};function a(e,t,i){function a(e,i,r){return"string"==typeof t?t:t(e,i,r)}i||(i=Error);var o=function(e){function t(t,i,r){return e.call(this,a(t,i,r))||this}return r(t,e),t}(i);o.prototype.name=i.name,o.prototype.code=e,n[e]=o}function o(e,t){if(Array.isArray(e)){var i=e.length;return e=e.map((function(e){return String(e)})),i>2?"one of ".concat(t," ").concat(e.slice(0,i-1).join(", "),", or ")+e[i-1]:2===i?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}function s(e,t,i){return e.substr(0,t.length)===t}function l(e,t,i){return(void 0===i||i>e.length)&&(i=e.length),e.substring(i-t.length,i)===t}function u(e,t,i){return"number"!=typeof i&&(i=0),!(i+t.length>e.length)&&-1!==e.indexOf(t,i)}a("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),a("ERR_INVALID_ARG_TYPE",(function(e,t,i){var r,n;if("string"==typeof t&&s(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",l(e," argument"))n="The ".concat(e," ").concat(r," ").concat(o(t,"type"));else{var a=u(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(a," ").concat(r," ").concat(o(t,"type"))}return n+=". Received type ".concat(typeof i)}),TypeError),a("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),a("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),a("ERR_STREAM_PREMATURE_CLOSE","Premature close"),a("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),a("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),a("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),a("ERR_STREAM_WRITE_AFTER_END","write after end"),a("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),a("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],67:[function(e,t,i){(function(i){(function(){var r=Object.keys||function(e){var t=[];for(var i in e)t.push(i);return t};t.exports=u;var n=e("./_stream_readable"),a=e("./_stream_writable");e("inherits")(u,n);for(var o=r(a.prototype),s=0;s<o.length;s++){var l=o[s];u.prototype[l]||(u.prototype[l]=a.prototype[l])}function u(e){if(!(this instanceof u))return new u(e);n.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readaLine truncated
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
read:function(e,t,i,r,n){var a,o,s=8*n-r-1,l=(1<<s)-1,u=l>>1,h=-7,c=i?n-1:0,f=i?-1:1,d=e[t+c];for(c+=f,a=d&(1<<-h)-1,d>>=-h,h+=s;h>0;a=256*a+e[t+c],c+=f,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=r;h>0;o=256*o+e[t+c],c+=f,h-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,r),a-=u}return(d?-1:1)*o*Math.pow(2,a-r)},write:function(e,t,i,r,n,a){var o,s,l,u=8*a-n-1,h=(1<<u)-1,c=h>>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+c>=1?f/l:f*Math.pow(2,1-c))*l>=2&&(o++,l/=2),o+c>=h?(s=0,o=h):o+c>=1?(s=(t*l-1)*Math.pow(2,n),o+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;e[i+d]=255&s,d+=p,s/=256,n-=8);for(o=o<<n|s,u+=n;u>0;e[i+d]=255&o,d+=p,o/=256,u-=8);e[i+d-p]|=128*m}};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AnsiStringType=e.StringType=e.BufferType=e.Uint8ArrayType=e.IgnoreType=e.Float80_LE=e.Float80_BE=e.Float64_LE=e.Float64_BE=e.Float32_LE=e.Float32_BE=e.Float16_LE=e.Float16_BE=e.INT64_BE=e.UINT64_BE=e.INT64_LE=e.UINT64_LE=e.INT32_LE=e.INT32_BE=e.INT24_BE=e.INT24_LE=e.INT16_LE=e.INT16_BE=e.INT8=e.UINT32_BE=e.UINT32_LE=e.UINT24_BE=e.UINT24_LE=e.UINT16_BE=e.UINT16_LE=e.UINT8=void 0;const t=ieee754;function i(e){return new DataView(e.buffer,e.byteOffset)}e.UINT8={len:1,get:(e,t)=>i(e).getUint8(t),put:(e,t,r)=>(i(e).setUint8(t,r),t+1)},e.UINT16_LE={len:2,get:(e,t)=>i(e).getUint16(t,!0),put:(e,t,r)=>(i(e).setUint16(t,r,!0),t+2)},e.UINT16_BE={len:2,get:(e,t)=>i(e).getUint16(t),put:(e,t,r)=>(i(e).setUint16(t,r),t+2)},e.UINT24_LE={len:3,get(e,t){const r=i(e);return r.getUint8(t)+(r.getUint16(t+1,!0)<<8)},put(e,t,r){const n=i(e);return n.setUint8(t,255&r),n.setUint16(t+1,r>>8,!0),t+3}},e.UINT24_BE={len:3,get(e,t){const r=i(e);return(r.getUint16(t)<<8)+r.getUint8(t+2)},put(e,t,r){const n=i(e);return n.setUint16(t,r>>8),n.setUint8(t+2,255&r),t+3}},e.UINT32_LE={len:4,get:(e,t)=>i(e).getUint32(t,!0),put:(e,t,r)=>(i(e).setUint32(t,r,!0),t+4)},e.UINT32_BE={len:4,get:(e,t)=>i(e).getUint32(t),put:(e,t,r)=>(i(e).setUint32(t,r),t+4)},e.INT8={len:1,get:(e,t)=>i(e).getInt8(t),put:(e,t,r)=>(i(e).setInt8(t,r),t+1)},e.INT16_BE={len:2,get:(e,t)=>i(e).getInt16(t),put:(e,t,r)=>(i(e).setInt16(t,r),t+2)},e.INT16_LE={len:2,get:(e,t)=>i(e).getInt16(t,!0),put:(e,t,r)=>(i(e).setInt16(t,r,!0),t+2)},e.INT24_LE={len:3,get(t,i){const r=e.UINT24_LE.get(t,i);return r>8388607?r-16777216:r},put(e,t,r){const n=i(e);return n.setUint8(t,255&r),n.setUint16(t+1,r>>8,!0),t+3}},e.INT24_BE={len:3,get(t,i){const r=e.UINT24_BE.get(t,i);return r>8388607?r-16777216:r},put(e,t,r){const n=i(e);return n.setUint16(t,r>>8),n.setUint8(t+2,255&r),t+3}},e.INT32_BE={len:4,get:(e,t)=>i(e).getInt32(t),put:(e,t,r)=>(i(e).setInt32(t,r),t+4)},e.INT32_LE={len:4,get:(e,t)=>i(e).getInt32(t,!0),put:(e,t,r)=>(i(e).setInt32(t,r,!0),t+4)},e.UINT64_LE={len:8,get:(e,t)=>i(e).getBigUint64(t,!0),put:(e,t,r)=>(i(e).setBigUint64(t,r,!0),t+8)},e.INT64_LE={len:8,get:(e,t)=>i(e).getBigInt64(t,!0),put:(e,t,r)=>(i(e).setBigInt64(t,r,!0),t+8)},e.UINT64_BE={len:8,get:(e,t)=>i(e).getBigUint64(t),put:(e,t,r)=>(i(e).setBigUint64(t,r),t+8)},e.INT64_BE={len:8,get:(e,t)=>i(e).getBigInt64(t),put:(e,t,r)=>(i(e).setBigInt64(t,r),t+8)},e.Float16_BE={len:2,get(e,i){return t.read(e,i,!1,10,this.len)},put(e,i,r){return t.write(e,r,i,!1,10,this.len),i+this.len}},e.Float16_LE={len:2,get(e,i){return t.read(e,i,!0,10,this.len)},put(e,i,r){return t.write(e,r,i,!0,10,this.len),i+this.len}},e.Float32_BE={len:4,get:(e,t)=>i(e).getFloat32(t),put:(e,t,r)=>(i(e).setFloat32(t,r),t+4)},e.Float32_LE={len:4,get:(e,t)=>i(e).getFloat32(t,!0),put:(e,t,r)=>(i(e).setFloat32(t,r,!0),t+4)},e.Float64_BE={len:8,get:(e,t)=>i(e).getFloat64(t),put:(e,t,r)=>(i(e).setFloat64(t,r),t+8)},e.Float64_LE={len:8,get:(e,t)=>i(e).getFloat64(t,!0),put:(e,t,r)=>(i(e).setFloat64(t,r,!0),t+8)},e.Float80_BE={len:10,get(e,i){return t.read(e,i,!1,63,this.len)},put(e,i,r){return t.write(e,r,i,!1,63,this.len),i+this.len}},e.Float80_LE={len:10,get(e,i){return t.read(e,i,!0,63,this.len)},put(e,i,r){return t.write(e,r,i,!0,63,this.len),i+this.len}};e.IgnoreType=class{constructor(e){this.len=e}get(e,t){}};e.Uint8ArrayType=class{constructor(e){this.len=e}get(e,t){return e.subarray(t,t+this.len)}};e.BufferType=class{constructor(e){this.len=e}get(e,t){return Buffer.from(e.subarray(t,t+this.len))}};e.StringType=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t){return Buffer.from(e).toString(this.encoding,t,t+this.len)}};class r{constructor(e){this.len=e}static decode(e,t,i){let n="";for(let a=t;a<i;++a)n+=r.codePointToString(r.singleByteDecoder(e[a]));return n}static inRange(e,t,i){return t<=e&&e<=i}static codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}static singleByteDecoder(e){if(r.inRange(e,0,127))return e;const t=r.windows1252[e-128];if(null===t)throw Error("invalLine truncated
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* cie94.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* ciede2000.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* cmetric.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* common.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* constants.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* ditherErrorDiffusionArray.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* euclidean.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* helper.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* hueStatistics.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* iq.ts - Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* lab2rgb.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* lab2xyz.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* manhattanNeuQuant.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* nearestColor.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* palette.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* pngQuant.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* point.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* pointContainer.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* rgb2hsl.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* rgb2lab.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* rgb2xyz.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* ssim.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* wuQuant.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* xyz2lab.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* xyz2rgb.ts - part of Image Quantization Library
*/
/**
* @preserve
* MIT License
*
* Copyright 2015-2018 Igor Bezkrovnyi
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* riemersma.ts - part of Image Quantization Library
*/
/**
* @preserve TypeScript port:
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* colorHistogram.ts - part of Image Quantization Library
*/
/**
* @preserve TypeScript port:
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* neuquant.ts - part of Image Quantization Library
*/
/**
* @preserve TypeScript port:
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* rgbquant.ts - part of Image Quantization Library
*/"function"==typeof setImmediate?setImmediate:"undefined"!=typeof process&&(null==process||process.nextTick);const QuantizeOptionsSchema=z.object({colors:z.number().optional(),colorDistanceFormula:z.union([z.literal("cie94-textiles"),z.literal("cie94-graphic-arts"),z.literal("ciede2000"),z.literal("color-metric"),z.literal("euclidean"),z.literal("euclidean-bt709-noalpha"),z.literal("euclidean-bt709"),z.literal("manhattan"),z.literal("manhattan-bt709"),z.literal("manhattan-nommyde"),z.literal("pngquant")]).optional(),paletteQuantization:z.union([z.literal("neuquant"),z.literal("neuquant-float"),z.literal("rgbquant"),z.literal("wuquant")]).optional(),imageQuantization:z.union([z.literal("nearest"),z.literal("riemersma"),z.literal("floyd-steinberg"),z.literal("false-floyd-steinberg"),z.literal("stucki"),z.literal("atkinson"),z.literal("jarvis"),z.literal("burkes"),z.literal("sierra"),z.literal("two-sierra"),z.literal("sierra-lite")]).optional()}),methods={quantize(e,t){const{colors:i,colorDistanceFormula:r,paletteQuantization:n,imageQuantization:a}=QuantizeOptionsSchema.parse(t),o=utils_exports.PointContainer.fromUint8Array(e.bitmap.data,e.bitmap.width,e.bitmap.height),s=applyPaletteSync(o,buildPaletteSync([o],{colors:i,colorDistanceFormula:r,paletteQuantization:n}),{colorDistanceFormula:r,imageQuantization:a});return e.bitmap.data=Buffer.from(s.toUint8Array()),e}};var parseBmfontAscii=function(e){if(!e)throw new Error("no data provided");var t={pages:[],chars:[],kernings:[]},i=(e=e.toString().trim()).split(/\r\n?|\n/g);if(0===i.length)throw new Error("no data in BMFont file");for(var r=0;r<i.length;r++){var n=splitLine(i[r],r);if(n)if("page"===n.key){if("number"!=typeof n.data.id)throw new Error("malformed file at line "+r+" -- needs page id=N");if("string"!=typeof n.data.file)throw new Error("malformed file at line "+r+' -- needs page file="path"');t.pages[n.data.id]=n.data.file}else"chars"===n.key||"kernings"===n.key||("char"===n.key?t.chars.push(n.data):"kerning"===n.key?t.kernings.push(n.data):t[n.key]=n.data)}return t};function splitLine(e,t){if(!(e=e.replace(/\t+/g," ").trim()))return null;var i=e.indexOf(" ");if(-1===i)throw new Error("no named row at line "+t);var r=e.substring(0,i);e=(e=(e=(e=e.substring(i+1)).replace(/letter=[\'\"]\S+[\'\"]/gi,"")).split("=")).map((function(e){return e.trim().match(/(".*?"|[^"\s]+)+(?=\s*|\s*$)/g)}));for(var n=[],a=0;a<e.length;a++){var o=e[a];0===a?n.push({key:o[0],data:""}):a===e.length-1?n[n.length-1].data=parseData(o[0]):(n[n.length-1].data=parseData(o[0]),n.push({key:o[1],data:""}))}var s={key:r,data:{}};return n.forEach((function(e){s.data[e.key]=e.data})),s}function parseData(e){return e&&0!==e.length?0===e.indexOf('"')||0===e.indexOf("'")?e.substring(1,e.length-1):-1!==e.indexOf(",")?parseIntList$1(e):parseInt(e,10):""}function parseIntList$1(e){return e.split(",").map((function(e){return parseInt(e,10)}))}var parseASCII=getDefaultExportFromCjs(parseBmfontAscii),GLYPH_DESIGNER_ERROR="chasrset",parseAttribs=function(e){for(var t in e=Object.assign({},e),GLYPH_DESIGNER_ERROR in e&&(e.charset=e[GLYPH_DESIGNER_ERROR],delete e[GLYPH_DESIGNER_ERROR]),e)"face"!==t&&"charset"!==t&&(e[t]="padding"===t||"spacing"===t?parseIntList(e[t]):parseInt(e[t],10));return e};function parseIntList(e){return e.split(",").map((function(e){return parseInt(e,10)}))}var xmlParseFromString=void 0!==self.DOMParser?function(e){return(new self.DOMParser).parseFromString(e,"application/xml")}:void 0!==self.ActiveXObject&&new self.ActiveXObject("Microsoft.XMLDOM")?function(e){var t=new self.ActiveXObject("Microsoft.XMLDOM");return t.async="false",t.loadXML(e),t}:function(e){var t=document.createElement("div");return t.innerHTML=e,t},parseAttributes=parseAttribs,parseFromString=xmlParseFromString,NAME_MAP={scaleh:"scaleH",scalew:"scaleW",stretchh:"stretchH",lineheight:"lineHeight",alphachnl:"alphaChnl",redchnl:"redChnl",greenchnl:"greenChnl",bluechnl:"blueChnl"},browser=function(e){e=e.toString();var t=parseFromString(e),i={pages:[],chars:[],kernings:[]};["info","common"].forEach((function(e){var r=t.getElementsByTagName(e)[0];r&&(i[e]=parseAttributes(getAttribs(r)))}));var r=t.getElementsByTagName("pages")[0];if(!r)throw new Error("malformed file -- no <pages> element");for(var n=r.getElementsByTagName("page"),a=0;a<n.length;a++){var o=n[a],s=parseInt(o.getAttribute("id"),10),l=o.getAttribute("file");if(isNaN(s))throw new Error('malformed file -- page "id" attribute is NaN');if(!l)throw new Error('malformed file -- needs page "file" attribute');i.pages[parseInt(s,10)]=l}return["chars","kernings"].forEach((function(e){var r=t.getElementsByTagName(e)[0];if(r)for(var n=e.substring(0,e.length-1),a=r.getElementsByTagName(n),o=0;o<a.length;o++){var s=a[o];i[e].push(parseAttributes(getAttribs(s)))}})),i};function getAttribs(e){return getAttribList(e).reduce((function(e,t){return e[mapName(t.nodeName)]=t.nodeValue,e}),{})}function getAttribList(e){for(var t=[],i=0;i<e.attributes.length;i++)t.pusLine truncated
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../../../node_modules/.pnpm/node-self@1.0.2/node_modules/node-self/index.js","../../../../node_modules/.pnpm/bmp-ts@1.0.9/node_modules/bmp-ts/dist/esm/header-types.js","../../../../node_modules/.pnpm/bmp-ts@1.0.9/node_modules/bmp-ts/dist/esm/types.js","../../../../node_modules/.pnpm/bmp-ts@1.0.9/node_modules/bmp-ts/dist/esm/mask-color.js","../../../../node_modules/.pnpm/bmp-ts@1.0.9/node_modules/bmp-ts/dist/esm/decoder.js","../../../../node_modules/.pnpm/bmp-ts@1.0.9/node_modules/bmp-ts/dist/esm/encoder.js","../../../../node_modules/.pnpm/bmp-ts@1.0.9/node_modules/bmp-ts/dist/esm/index.js","../../../../node_modules/.pnpm/tinycolor2@1.6.0/node_modules/tinycolor2/esm/tinycolor.js","../../../utils/dist/esm/index.js","../../../../plugins/js-bmp/dist/esm/index.js","../../../../node_modules/.pnpm/omggif@1.0.10/node_modules/omggif/omggif.js","../../../../node_modules/.pnpm/gifwrap@0.10.1/node_modules/gifwrap/src/bitmapimage.js","../../../../node_modules/.pnpm/gifwrap@0.10.1/node_modules/gifwrap/src/gif.js","../../../../node_modules/.pnpm/image-q@4.0.0/node_modules/image-q/dist/cjs/image-q.cjs","../../../../node_modules/.pnpm/gifwrap@0.10.1/node_modules/gifwrap/src/gifframe.js","../../../../node_modules/.pnpm/gifwrap@0.10.1/node_modules/gifwrap/src/gifutil.js","../../../../node_modules/.pnpm/gifwrap@0.10.1/node_modules/gifwrap/src/gifcodec.js","../../../../node_modules/.pnpm/gifwrap@0.10.1/node_modules/gifwrap/src/index.js","../../../../plugins/js-gif/dist/esm/index.js","../../../../node_modules/.pnpm/jpeg-js@0.4.4/node_modules/jpeg-js/lib/encoder.js","../../../../node_modules/.pnpm/jpeg-js@0.4.4/node_modules/jpeg-js/lib/decoder.js","../../../../node_modules/.pnpm/jpeg-js@0.4.4/node_modules/jpeg-js/index.js","../../../../plugins/js-jpeg/dist/esm/index.js","../../../../node_modules/.pnpm/pngjs@7.0.0/node_modules/pngjs/browser.js","../../../../plugins/js-png/dist/esm/constants.js","../../../../plugins/js-png/dist/esm/index.js","../../../../node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/utils/common.js","../../../../node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/trees.js","../../../../node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/adler32.js","../../../../node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/crc32.js","../../../../node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/messages.js","../../../../node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/deflate.js","../../../../node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/utils/strings.js","../../../../node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/zstream.js","../../../../node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/deflate.js","../../../../node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/inffast.js","../../../../node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/inftrees.js","../../../../node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/inflate.js","../../../../node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/constants.js","../../../../node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/gzheader.js","../../../../node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/inflate.js","../../../../node_modules/.pnpm/pako@1.0.11/node_modules/pako/index.js","../../../../node_modules/.pnpm/utif2@4.1.0/node_modules/utif2/UTIF.js","../../../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs","../../../../plugins/js-tiff/dist/esm/index.js","../../../types/dist/esm/index.js","../../../../plugins/plugin-blit/dist/esm/index.js","../../../../plugins/plugin-blur/dist/esm/blur-tables.js","../../../../plugins/plugin-blur/dist/esm/index.js","../../../../plugins/plugin-circle/dist/esm/index.js","../../../../plugins/plugin-color/dist/esm/index.js","../../../../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js","../../../../node_modules/.pnpm/token-types@4.2.1/node_modules/token-types/lib/index.js","../../../../node_modules/.pnpm/peek-readable@4.1.0/node_modules/peek-readable/lib/EndOfFileStream.js","../../../../node_modules/.pnpm/peek-readable@4.1.0/node_modules/peek-readable/lib/Deferred.js","../../../../node_modules/.pnpm/peek-readable@4.1.0/node_modules/peek-readable/lib/StreamReader.js","../../../../node_modules/.pnpm/peek-readable@4.1.0/node_modules/peek-readable/lib/index.js","../../../../node_modules/.pnpm/strtok3@6.3.0/node_modules/strtok3/lib/AbstractTokenizer.js","../../../../node_modules/.pnpm/strtok3@6.3.0/node_modules/strtok3/lib/ReadStreamTokenizer.js","../../../../node_modules/.pnpm/strtok3@6.3.0/node_modules/strtok3/lib/BufferTokenizer.js","../../../../node_modules/.pnpm/strtok3@6.3.0/node_modules/strtok3/lib/core.js","../../../../node_modules/.pnpm/file-type@16.5.4/node_modules/file-type/util.js","../../../../node_modules/.pnpm/file-type@16.5.4/node_modules/file-type/supported.js","../../../../node_modules/.pnpm/file-type@16.5.4/node_modules/file-type/core.js","../../../../node_modules/.pnLine truncated
+3
View File
@@ -0,0 +1,3 @@
{
"type": "module"
}
+5
View File
@@ -0,0 +1,5 @@
/**
* @module jimp/fonts
*/
export * from "@jimp/plugin-print/fonts";
//# sourceMappingURL=fonts.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../src/fonts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,0BAA0B,CAAC"}
+21
View File
@@ -0,0 +1,21 @@
"use strict";
/**
* @module jimp/fonts
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("@jimp/plugin-print/fonts"), exports);
//# sourceMappingURL=fonts.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"fonts.js","sourceRoot":"","sources":["../../src/fonts.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,2DAAyC"}
+1764
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,GAAG,EAAE,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,IAAI,MAAM,eAAe,CAAC;AACjC,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,IAAI,MAAM,eAAe,CAAC;AAEjC,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAE1C,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,oBAAoB,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AE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5D,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,YAAY,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvE,YAAY,EACV,YAAY,EACZ,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
+187
View File
@@ -0,0 +1,187 @@
"use strict";
/**
* @module jimp
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.cssColorToHex = exports.limit255 = exports.colorDiff = exports.rgbaToInt = exports.intToRGBA = exports.diff = exports.measureTextHeight = exports.measureText = exports.loadFont = exports.BlendMode = exports.VerticalAlign = exports.HorizontalAlign = exports.BmpCompression = exports.PNGFilterType = exports.PNGColorType = exports.compareHashes = exports.distance = exports.ResizeStrategy = exports.Jimp = exports.JimpMime = exports.defaultFormats = exports.defaultPlugins = void 0;
// import { Jimp } from "@jimp/core";
const js_bmp_1 = __importStar(require("@jimp/js-bmp"));
const js_gif_1 = __importDefault(require("@jimp/js-gif"));
const js_jpeg_1 = __importDefault(require("@jimp/js-jpeg"));
const js_png_1 = __importDefault(require("@jimp/js-png"));
const js_tiff_1 = __importDefault(require("@jimp/js-tiff"));
const blit = __importStar(require("@jimp/plugin-blit"));
const blur = __importStar(require("@jimp/plugin-blur"));
const circle = __importStar(require("@jimp/plugin-circle"));
const color = __importStar(require("@jimp/plugin-color"));
const contain = __importStar(require("@jimp/plugin-contain"));
const cover = __importStar(require("@jimp/plugin-cover"));
const crop = __importStar(require("@jimp/plugin-crop"));
const displace = __importStar(require("@jimp/plugin-displace"));
const dither = __importStar(require("@jimp/plugin-dither"));
const fisheye = __importStar(require("@jimp/plugin-fisheye"));
const flip = __importStar(require("@jimp/plugin-flip"));
const hash = __importStar(require("@jimp/plugin-hash"));
const mask = __importStar(require("@jimp/plugin-mask"));
const print = __importStar(require("@jimp/plugin-print"));
const resize = __importStar(require("@jimp/plugin-resize"));
const rotate = __importStar(require("@jimp/plugin-rotate"));
const threshold = __importStar(require("@jimp/plugin-threshold"));
const quantize = __importStar(require("@jimp/plugin-quantize"));
const core_1 = require("@jimp/core");
exports.defaultPlugins = [
blit.methods,
blur.methods,
circle.methods,
color.methods,
contain.methods,
cover.methods,
crop.methods,
displace.methods,
dither.methods,
fisheye.methods,
flip.methods,
hash.methods,
mask.methods,
print.methods,
resize.methods,
rotate.methods,
threshold.methods,
quantize.methods,
];
exports.defaultFormats = [js_bmp_1.default, js_bmp_1.msBmp, js_gif_1.default, js_jpeg_1.default, js_png_1.default, js_tiff_1.default];
/** Convenience object for getting the MIME types of the default formats */
exports.JimpMime = {
bmp: (0, js_bmp_1.default)().mime,
gif: (0, js_gif_1.default)().mime,
jpeg: (0, js_jpeg_1.default)().mime,
png: (0, js_png_1.default)().mime,
tiff: (0, js_tiff_1.default)().mime,
};
// TODO: This doesn't document the constructor of the class
/**
* @class
*
* A `Jimp` class enables you to:class
*
* - Read an image into a "bit map" (a collection of pixels)
* - Modify the bit map through methods that change the pixels
* - Write the bit map back to an image buffer
*
* @example
*
* #### Basic
*
* You can use the Jimp class to make empty images.
* This is useful for when you want to create an image that composed of other images on top of a background.
*
* ```ts
* import { Jimp } from "jimp";
*
* const image = new Jimp({ width: 256, height: 256, color: 0xffffffff });
* const image2 = new Jimp({ width: 100, height: 100, color: 0xff0000ff });
*
* image.composite(image2, 50, 50);
* ```
*
* #### Node
*
* You can use jimp in Node.js.
* For example you can read an image from a file and resize it and
* then write it back to a file.
*
* ```ts
* import { Jimp } from "jimp";
* import { promises as fs } from "fs";
*
* const image = await Jimp.read("test/image.png");
*
* image.resize(256, 100);
* image.greyscale();
*
* await image.write('test/output.png');
* ```
*
* #### Browser
*
* You can use jimp in the browser by reading files from URLs
*
* ```ts
* import { Jimp } from "jimp";
*
* const image = await Jimp.read("https://upload.wikimedia.org/wikipedia/commons/0/01/Bot-Test.jpg");
*
* image.resize(256, 100);
* image.greyscale();
*
* const output = await image.getBuffer("test/image.png");
*
* const canvas = document.createElement("canvas");
*
* canvas.width = image.bitmap.width;
* canvas.height = image.bitmap.height;
*
* const ctx = canvas.getContext("2d");
* ctx.putImageData(image.bitmap, 0, 0);
*
* document.body.appendChild(canvas);
* ```
*/
exports.Jimp = (0, core_1.createJimp)({
formats: exports.defaultFormats,
plugins: exports.defaultPlugins,
});
var plugin_resize_1 = require("@jimp/plugin-resize");
Object.defineProperty(exports, "ResizeStrategy", { enumerable: true, get: function () { return plugin_resize_1.ResizeStrategy; } });
var plugin_hash_1 = require("@jimp/plugin-hash");
Object.defineProperty(exports, "distance", { enumerable: true, get: function () { return plugin_hash_1.distance; } });
Object.defineProperty(exports, "compareHashes", { enumerable: true, get: function () { return plugin_hash_1.compareHashes; } });
var js_png_2 = require("@jimp/js-png");
Object.defineProperty(exports, "PNGColorType", { enumerable: true, get: function () { return js_png_2.PNGColorType; } });
Object.defineProperty(exports, "PNGFilterType", { enumerable: true, get: function () { return js_png_2.PNGFilterType; } });
var js_bmp_2 = require("@jimp/js-bmp");
Object.defineProperty(exports, "BmpCompression", { enumerable: true, get: function () { return js_bmp_2.BmpCompression; } });
var core_2 = require("@jimp/core");
Object.defineProperty(exports, "HorizontalAlign", { enumerable: true, get: function () { return core_2.HorizontalAlign; } });
Object.defineProperty(exports, "VerticalAlign", { enumerable: true, get: function () { return core_2.VerticalAlign; } });
Object.defineProperty(exports, "BlendMode", { enumerable: true, get: function () { return core_2.BlendMode; } });
var load_font_1 = require("@jimp/plugin-print/load-font");
Object.defineProperty(exports, "loadFont", { enumerable: true, get: function () { return load_font_1.loadFont; } });
var plugin_print_1 = require("@jimp/plugin-print");
Object.defineProperty(exports, "measureText", { enumerable: true, get: function () { return plugin_print_1.measureText; } });
Object.defineProperty(exports, "measureTextHeight", { enumerable: true, get: function () { return plugin_print_1.measureTextHeight; } });
var diff_1 = require("@jimp/diff");
Object.defineProperty(exports, "diff", { enumerable: true, get: function () { return diff_1.diff; } });
var utils_1 = require("@jimp/utils");
Object.defineProperty(exports, "intToRGBA", { enumerable: true, get: function () { return utils_1.intToRGBA; } });
Object.defineProperty(exports, "rgbaToInt", { enumerable: true, get: function () { return utils_1.rgbaToInt; } });
Object.defineProperty(exports, "colorDiff", { enumerable: true, get: function () { return utils_1.colorDiff; } });
Object.defineProperty(exports, "limit255", { enumerable: true, get: function () { return utils_1.limit255; } });
Object.defineProperty(exports, "cssColorToHex", { enumerable: true, get: function () { return utils_1.cssColorToHex; } });
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,qCAAqC;AAErC,uDAA0C;AAC1C,0DAA+B;AAC/B,4DAAiC;AACjC,0DAA+B;AAC/B,4DAAiC;AAEjC,wDAA0C;AAC1C,wDAA0C;AAC1C,4DAA8C;AAC9C,0DAA4C;AAC5C,8DAAgD;AAChD,0DAA4C;AAC5C,wDAA0C;AAC1C,gEAAkD;AAClD,4DAA8C;AAC9C,8DAAgD;AAChD,wDAA0C;AAC1C,wDAA0C;AAC1C,wDAA0C;AAC1C,0DAA4C;AAC5C,4DAA8C;AAC9C,4DAA8C;AAC9C,kEAAoD;AACpD,gEAAkD;AAElD,qCAAwC;AAE3B,QAAA,cAAc,GAAG;IAC5B,IAAI,CAAC,OAAO;IACZ,IAAI,CAAC,OAAO;IACZ,MAAM,CAAC,OAAO;IACd,KAAK,CAAC,OAAO;IACb,OAAO,CAAC,OAAO;IACf,KAAK,CAAC,OAAO;IACb,IAAI,CAAC,OAAO;IACZ,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qGAAA,QAAQ,OAAA;AACjB,mDAAoE;AAA3D,2GAAA,WAAW,OAAA;AAAE,iHAAA,iBAAiB,OAAA;AACvC,mCAAkC;AAAzB,4FAAA,IAAI,OAAA;AACb,qCAMqB;AALnB,kGAAA,SAAS,OAAA;AACT,kGAAA,SAAS,OAAA;AACT,kGAAA,SAAS,OAAA;AACT,iGAAA,QAAQ,OAAA;AACR,sGAAA,aAAa,OAAA"}
+3
View File
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}
+5
View File
@@ -0,0 +1,5 @@
/**
* @module jimp/fonts
*/
export * from "@jimp/plugin-print/fonts";
//# sourceMappingURL=fonts.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../src/fonts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,0BAA0B,CAAC"}
+5
View File
@@ -0,0 +1,5 @@
/**
* @module jimp/fonts
*/
export * from "@jimp/plugin-print/fonts";
//# sourceMappingURL=fonts.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"fonts.js","sourceRoot":"","sources":["../../src/fonts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,0BAA0B,CAAC"}
+1764
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,GAAG,EAAE,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,IAAI,MAAM,eAAe,CAAC;AACjC,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,IAAI,MAAM,eAAe,CAAC;AAEjC,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAE1C,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,KAAK,MAAM,oBAAoB,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jimp } from "@jimp/core";
import bmp, { msBmp } from "@jimp/js-bmp";
import gif from "@jimp/js-gif";
import jpeg from "@jimp/js-jpeg";
import png from "@jimp/js-png";
import tiff from "@jimp/js-tiff";
import * as blit from "@jimp/plugin-blit";
import * as blur from "@jimp/plugin-blur";
import * as circle from "@jimp/plugin-circle";
import * as color from "@jimp/plugin-color";
import * as contain from "@jimp/plugin-contain";
import * as cover from "@jimp/plugin-cover";
import * as crop from "@jimp/plugin-crop";
import * as displace from "@jimp/plugin-displace";
import * as dither from "@jimp/plugin-dither";
import * as fisheye from "@jimp/plugin-fisheye";
import * as flip from "@jimp/plugin-flip";
import * as hash from "@jimp/plugin-hash";
import * as mask from "@jimp/plugin-mask";
import * as print from "@jimp/plugin-print";
import * as resize from "@jimp/plugin-resize";
import * as rotate from "@jimp/plugin-rotate";
import * as threshold from "@jimp/plugin-threshold";
import * as quantize from "@jimp/plugin-quantize";
import { createJimp } from "@jimp/core";
export const defaultPlugins = [
blit.methods,
blur.methods,
circle.methods,
color.methods,
contain.methods,
cover.methods,
crop.methods,
displace.methods,
dither.methods,
fisheye.methods,
flip.methods,
hash.methods,
mask.methods,
print.methods,
resize.methods,
rotate.methods,
threshold.methods,
quantize.methods,
];
export const defaultFormats = [bmp, msBmp, gif, jpeg, png, tiff];
/** Convenience object for getting the MIME types of the default formats */
export const JimpMime = {
bmp: bmp().mime,
gif: gif().mime,
jpeg: jpeg().mime,
png: png().mime,
tiff: tiff().mime,
};
// TODO: This doesn't document the constructor of the class
/**
* @class
*
* A `Jimp` class enables you to:class
*
* - Read an image into a "bit map" (a collection of pixels)
* - Modify the bit map through methods that change the pixels
* - Write the bit map back to an image buffer
*
* @example
*
* #### Basic
*
* You can use the Jimp class to make empty images.
* This is useful for when you want to create an image that composed of other images on top of a background.
*
* ```ts
* import { Jimp } from "jimp";
*
* const image = new Jimp({ width: 256, height: 256, color: 0xffffffff });
* const image2 = new Jimp({ width: 100, height: 100, color: 0xff0000ff });
*
* image.composite(image2, 50, 50);
* ```
*
* #### Node
*
* You can use jimp in Node.js.
* For example you can read an image from a file and resize it and
* then write it back to a file.
*
* ```ts
* import { Jimp } from "jimp";
* import { promises as fs } from "fs";
*
* const image = await Jimp.read("test/image.png");
*
* image.resize(256, 100);
* image.greyscale();
*
* await image.write('test/output.png');
* ```
*
* #### Browser
*
* You can use jimp in the browser by reading files from URLs
*
* ```ts
* import { Jimp } from "jimp";
*
* const image = await Jimp.read("https://upload.wikimedia.org/wikipedia/commons/0/01/Bot-Test.jpg");
*
* image.resize(256, 100);
* image.greyscale();
*
* const output = await image.getBuffer("test/image.png");
*
* const canvas = document.createElement("canvas");
*
* canvas.width = image.bitmap.width;
* canvas.height = image.bitmap.height;
*
* const ctx = canvas.getContext("2d");
* ctx.putImageData(image.bitmap, 0, 0);
*
* document.body.appendChild(canvas);
* ```
*/
export const Jimp = createJimp({
formats: defaultFormats,
plugins: defaultPlugins,
});
export { ResizeStrategy } from "@jimp/plugin-resize";
export { distance, compareHashes } from "@jimp/plugin-hash";
export { PNGColorType, PNGFilterType } from "@jimp/js-png";
export { BmpCompression } from "@jimp/js-bmp";
export { HorizontalAlign, VerticalAlign, BlendMode } from "@jimp/core";
export { loadFont } from "@jimp/plugin-print/load-font";
export { measureText, measureTextHeight } from "@jimp/plugin-print";
export { diff } from "@jimp/diff";
export { intToRGBA, rgbaToInt, colorDiff, limit255, cssColorToHex, } from "@jimp/utils";
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,qCAAqC;AAErC,OAAO,GAAG,EAAE,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,IAAI,MAAM,eAAe,CAAC;AACjC,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,IAAI,MAAM,eAAe,CAAC;AAEjC,OAAO,K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Q,EACR,aAAa,GACd,MAAM,aAAa,CAAC"}
+3
View File
@@ -0,0 +1,3 @@
{
"type": "module"
}
+146
View File
@@ -0,0 +1,146 @@
{
"name": "jimp",
"version": "1.6.0",
"sideEffects": false,
"description": "An image processing library written entirely in JavaScript.",
"files": [
"browser.js",
"browser.js.map",
"dist",
"es",
"index.d.ts",
"fonts",
"types"
],
"repository": "jimp-dev/jimp",
"engines": {
"node": ">=18"
},
"scripts": {
"lint": "eslint .",
"test": "vitest --exclude '**/*.browser.test.ts'",
"test:browser": "vitest --config vitest.config.browser.mjs",
"build": "tshy",
"build:browser": "rollup -c",
"dev": "tshy --watch",
"clean": "rm -rf node_modules .tshy .tshy-build dist .turbo"
},
"keywords": [
"image",
"image processing",
"image manipulation",
"png",
"jpg",
"jpeg",
"bmp",
"resize",
"scale",
"crop"
],
"author": "Andrew Lisowski <lisowski54@gmail.com>",
"license": "MIT",
"dependencies": {
"@jimp/core": "1.6.0",
"@jimp/diff": "1.6.0",
"@jimp/js-bmp": "1.6.0",
"@jimp/js-gif": "1.6.0",
"@jimp/js-jpeg": "1.6.0",
"@jimp/js-png": "1.6.0",
"@jimp/js-tiff": "1.6.0",
"@jimp/plugin-blit": "1.6.0",
"@jimp/plugin-blur": "1.6.0",
"@jimp/plugin-circle": "1.6.0",
"@jimp/plugin-color": "1.6.0",
"@jimp/plugin-contain": "1.6.0",
"@jimp/plugin-cover": "1.6.0",
"@jimp/plugin-crop": "1.6.0",
"@jimp/plugin-displace": "1.6.0",
"@jimp/plugin-dither": "1.6.0",
"@jimp/plugin-fisheye": "1.6.0",
"@jimp/plugin-flip": "1.6.0",
"@jimp/plugin-hash": "1.6.0",
"@jimp/plugin-mask": "1.6.0",
"@jimp/plugin-print": "1.6.0",
"@jimp/plugin-quantize": "1.6.0",
"@jimp/plugin-resize": "1.6.0",
"@jimp/plugin-rotate": "1.6.0",
"@jimp/plugin-threshold": "1.6.0",
"@jimp/types": "1.6.0",
"@jimp/utils": "1.6.0"
},
"devDependencies": {
"@jimp/config-eslint": "1.6.0",
"@jimp/config-typescript": "1.6.0",
"@jimp/config-vitest": "1.6.0",
"@jimp/test-utils": "1.6.0",
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-inject": "^5.0.5",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@vitest/browser": "^2.0.5",
"eslint": "^9.9.1",
"node-self": "^1.0.2",
"path-browserify": "^1.0.1",
"rollup": "^4.21.2",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-esbuild": "^6.1.1",
"rollup-plugin-polyfill-node": "^0.13.0",
"tshy": "^3.0.2",
"typescript": "^5.5.4",
"vite-plugin-node-polyfills": "^0.22.0",
"vitest": "^2.0.5"
},
"tshy": {
"exclude": [
"**/*.test.ts"
],
"esmDialects": [
"browser"
],
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts",
"./fonts": "./src/fonts.ts"
}
},
"exports": {
"./package.json": "./package.json",
".": {
"browser": {
"types": "./dist/browser/index.d.ts",
"default": "./dist/browser/index.js"
},
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
},
"./fonts": {
"browser": {
"types": "./dist/browser/fonts.d.ts",
"default": "./dist/browser/fonts.js"
},
"import": {
"types": "./dist/esm/fonts.d.ts",
"default": "./dist/esm/fonts.js"
},
"require": {
"types": "./dist/commonjs/fonts.d.ts",
"default": "./dist/commonjs/fonts.js"
}
}
},
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"type": "module",
"publishConfig": {
"access": "public"
},
"module": "./dist/esm/index.js",
"gitHead": "c88abe6046dccbdb6e4f5f00c3dd403c81d83515"
}