jimp 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/index.d.ts +1450 -130
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +66 -83
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/package.json +2 -6
- package/dist/esm/index.d.ts +1450 -130
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +46 -82
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +2 -6
- package/package.json +34 -35
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG
|
|
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,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AAElD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAE1C,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AA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AAC;AACxD,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"}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -25,31 +25,34 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
__setModuleDefault(result, mod);
|
|
26
26
|
return result;
|
|
27
27
|
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
28
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.Jimp = void 0;
|
|
32
|
+
exports.cssColorToHex = exports.limit255 = exports.colorDiff = exports.rgbaToInt = exports.intToRGBA = exports.diff = exports.loadFont = exports.BlendMode = exports.VerticalAlign = exports.HorizontalAlign = exports.BmpCompression = exports.PNGFilterType = exports.PNGColorType = exports.compareHashes = exports.distance = exports.ResizeStrategy = exports.Jimp = void 0;
|
|
30
33
|
// import { Jimp } from "@jimp/core";
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
const js_bmp_1 = __importStar(require("@jimp/js-bmp"));
|
|
35
|
+
const js_gif_1 = __importDefault(require("@jimp/js-gif"));
|
|
36
|
+
const js_jpeg_1 = __importDefault(require("@jimp/js-jpeg"));
|
|
37
|
+
const js_png_1 = __importDefault(require("@jimp/js-png"));
|
|
38
|
+
const js_tiff_1 = __importDefault(require("@jimp/js-tiff"));
|
|
39
|
+
const blit = __importStar(require("@jimp/plugin-blit"));
|
|
40
|
+
const blur = __importStar(require("@jimp/plugin-blur"));
|
|
38
41
|
const circle = __importStar(require("@jimp/plugin-circle"));
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
const color = __importStar(require("@jimp/plugin-color"));
|
|
43
|
+
const contain = __importStar(require("@jimp/plugin-contain"));
|
|
44
|
+
const cover = __importStar(require("@jimp/plugin-cover"));
|
|
45
|
+
const crop = __importStar(require("@jimp/plugin-crop"));
|
|
46
|
+
const displace = __importStar(require("@jimp/plugin-displace"));
|
|
47
|
+
const dither = __importStar(require("@jimp/plugin-dither"));
|
|
48
|
+
const fisheye = __importStar(require("@jimp/plugin-fisheye"));
|
|
49
|
+
const flip = __importStar(require("@jimp/plugin-flip"));
|
|
50
|
+
const hash = __importStar(require("@jimp/plugin-hash"));
|
|
51
|
+
const mask = __importStar(require("@jimp/plugin-mask"));
|
|
52
|
+
const print = __importStar(require("@jimp/plugin-print"));
|
|
53
|
+
const resize = __importStar(require("@jimp/plugin-resize"));
|
|
54
|
+
const rotate = __importStar(require("@jimp/plugin-rotate"));
|
|
55
|
+
const threshold = __importStar(require("@jimp/plugin-threshold"));
|
|
53
56
|
const core_1 = require("@jimp/core");
|
|
54
57
|
// TODO: This doesn't document the constructor of the class
|
|
55
58
|
/**
|
|
@@ -121,69 +124,49 @@ const core_1 = require("@jimp/core");
|
|
|
121
124
|
* ```
|
|
122
125
|
*/
|
|
123
126
|
exports.Jimp = (0, core_1.createJimp)({
|
|
124
|
-
|
|
127
|
+
formats: [js_bmp_1.default, js_bmp_1.msBmp, js_gif_1.default, js_jpeg_1.default, js_png_1.default, js_tiff_1.default],
|
|
125
128
|
plugins: [
|
|
126
|
-
|
|
127
|
-
|
|
129
|
+
blit.methods,
|
|
130
|
+
blur.methods,
|
|
128
131
|
circle.methods,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
132
|
+
color.methods,
|
|
133
|
+
contain.methods,
|
|
134
|
+
cover.methods,
|
|
135
|
+
crop.methods,
|
|
136
|
+
displace.methods,
|
|
137
|
+
dither.methods,
|
|
138
|
+
fisheye.methods,
|
|
139
|
+
flip.methods,
|
|
140
|
+
hash.methods,
|
|
141
|
+
mask.methods,
|
|
142
|
+
print.methods,
|
|
143
|
+
resize.methods,
|
|
144
|
+
rotate.methods,
|
|
145
|
+
threshold.methods,
|
|
143
146
|
],
|
|
144
147
|
});
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
// export { PNGColorType, PNGFilterType } from "@jimp/js-png";
|
|
170
|
-
// export { BmpCompression } from "@jimp/js-bmp";
|
|
171
|
-
// export type { EncodeOptions } from "@jimp/js-bmp";
|
|
172
|
-
// export type { BmpColor } from "@jimp/js-bmp";
|
|
173
|
-
// export { HorizontalAlign, VerticalAlign, BlendMode } from "@jimp/core";
|
|
174
|
-
// export type {
|
|
175
|
-
// RawImageData,
|
|
176
|
-
// JimpConstructorOptions,
|
|
177
|
-
// JimpSimpleConstructorOptions,
|
|
178
|
-
// } from "@jimp/core";
|
|
179
|
-
// export type { Bitmap, Edge, RGBAColor, RGBColor } from "@jimp/types";
|
|
180
|
-
// export { loadFont } from "@jimp/plugin-print/load-font";
|
|
181
|
-
// export { diff } from "@jimp/diff";
|
|
182
|
-
// export {
|
|
183
|
-
// intToRGBA,
|
|
184
|
-
// rgbaToInt,
|
|
185
|
-
// colorDiff,
|
|
186
|
-
// limit255,
|
|
187
|
-
// cssColorToHex,
|
|
188
|
-
// } from "@jimp/utils";
|
|
148
|
+
var plugin_resize_1 = require("@jimp/plugin-resize");
|
|
149
|
+
Object.defineProperty(exports, "ResizeStrategy", { enumerable: true, get: function () { return plugin_resize_1.ResizeStrategy; } });
|
|
150
|
+
var plugin_hash_1 = require("@jimp/plugin-hash");
|
|
151
|
+
Object.defineProperty(exports, "distance", { enumerable: true, get: function () { return plugin_hash_1.distance; } });
|
|
152
|
+
Object.defineProperty(exports, "compareHashes", { enumerable: true, get: function () { return plugin_hash_1.compareHashes; } });
|
|
153
|
+
var js_png_2 = require("@jimp/js-png");
|
|
154
|
+
Object.defineProperty(exports, "PNGColorType", { enumerable: true, get: function () { return js_png_2.PNGColorType; } });
|
|
155
|
+
Object.defineProperty(exports, "PNGFilterType", { enumerable: true, get: function () { return js_png_2.PNGFilterType; } });
|
|
156
|
+
var js_bmp_2 = require("@jimp/js-bmp");
|
|
157
|
+
Object.defineProperty(exports, "BmpCompression", { enumerable: true, get: function () { return js_bmp_2.BmpCompression; } });
|
|
158
|
+
var core_2 = require("@jimp/core");
|
|
159
|
+
Object.defineProperty(exports, "HorizontalAlign", { enumerable: true, get: function () { return core_2.HorizontalAlign; } });
|
|
160
|
+
Object.defineProperty(exports, "VerticalAlign", { enumerable: true, get: function () { return core_2.VerticalAlign; } });
|
|
161
|
+
Object.defineProperty(exports, "BlendMode", { enumerable: true, get: function () { return core_2.BlendMode; } });
|
|
162
|
+
var load_font_1 = require("@jimp/plugin-print/load-font");
|
|
163
|
+
Object.defineProperty(exports, "loadFont", { enumerable: true, get: function () { return load_font_1.loadFont; } });
|
|
164
|
+
var diff_1 = require("@jimp/diff");
|
|
165
|
+
Object.defineProperty(exports, "diff", { enumerable: true, get: function () { return diff_1.diff; } });
|
|
166
|
+
var utils_1 = require("@jimp/utils");
|
|
167
|
+
Object.defineProperty(exports, "intToRGBA", { enumerable: true, get: function () { return utils_1.intToRGBA; } });
|
|
168
|
+
Object.defineProperty(exports, "rgbaToInt", { enumerable: true, get: function () { return utils_1.rgbaToInt; } });
|
|
169
|
+
Object.defineProperty(exports, "colorDiff", { enumerable: true, get: function () { return utils_1.colorDiff; } });
|
|
170
|
+
Object.defineProperty(exports, "limit255", { enumerable: true, get: function () { return utils_1.limit255; } });
|
|
171
|
+
Object.defineProperty(exports, "cssColorToHex", { enumerable: true, get: function () { return utils_1.cssColorToHex; } });
|
|
189
172
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG
|
|
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;AAEpD,qCAAwC;AAExC,2DAA2D;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;G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