@digipair/skill-sharp 0.95.5 → 0.95.7
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/index.cjs.js +18 -2
- package/index.esm.js +17 -3
- package/libs/skill-sharp/src/lib/skill-sharp.d.ts +2 -0
- package/package.json +1 -1
- package/schema.fr.json +399 -67
- package/schema.json +414 -64
package/index.cjs.js
CHANGED
|
@@ -40,9 +40,9 @@ let SharpService = class SharpService {
|
|
|
40
40
|
return buffer.toString('base64');
|
|
41
41
|
}
|
|
42
42
|
async resize(params, _pinsSettingsList, _context) {
|
|
43
|
-
const { content, width, height } = params;
|
|
43
|
+
const { content, width, height, options = {} } = params;
|
|
44
44
|
const { image, mimeType } = await this.loadImage(content);
|
|
45
|
-
image.resize(width, height);
|
|
45
|
+
image.resize(width, height, options);
|
|
46
46
|
return this.toBase64(image, mimeType);
|
|
47
47
|
}
|
|
48
48
|
async rotate(params, _pinsSettingsList, _context) {
|
|
@@ -84,6 +84,18 @@ let SharpService = class SharpService {
|
|
|
84
84
|
image.grayscale();
|
|
85
85
|
return this.toBase64(image, mimeType);
|
|
86
86
|
}
|
|
87
|
+
async linear(params, _pinsSettingsList, _context) {
|
|
88
|
+
const { content, multiplier, offset } = params;
|
|
89
|
+
const { image, mimeType } = await this.loadImage(content);
|
|
90
|
+
image.linear(multiplier, offset);
|
|
91
|
+
return this.toBase64(image, mimeType);
|
|
92
|
+
}
|
|
93
|
+
async threshold(params, _pinsSettingsList, _context) {
|
|
94
|
+
const { content, level = 128, option = {} } = params;
|
|
95
|
+
const { image, mimeType } = await this.loadImage(content);
|
|
96
|
+
image.threshold(level, option);
|
|
97
|
+
return this.toBase64(image, mimeType);
|
|
98
|
+
}
|
|
87
99
|
async negate(params, _pinsSettingsList, _context) {
|
|
88
100
|
const { content } = params;
|
|
89
101
|
const { image, mimeType } = await this.loadImage(content);
|
|
@@ -184,6 +196,8 @@ const extract = (params, pinsSettingsList, context)=>new SharpService().extract(
|
|
|
184
196
|
const flip = (params, pinsSettingsList, context)=>new SharpService().flip(params, pinsSettingsList, context);
|
|
185
197
|
const flop = (params, pinsSettingsList, context)=>new SharpService().flop(params, pinsSettingsList, context);
|
|
186
198
|
const grayscale = (params, pinsSettingsList, context)=>new SharpService().grayscale(params, pinsSettingsList, context);
|
|
199
|
+
const linear = (params, pinsSettingsList, context)=>new SharpService().linear(params, pinsSettingsList, context);
|
|
200
|
+
const threshold = (params, pinsSettingsList, context)=>new SharpService().threshold(params, pinsSettingsList, context);
|
|
187
201
|
const negate = (params, pinsSettingsList, context)=>new SharpService().negate(params, pinsSettingsList, context);
|
|
188
202
|
const tint = (params, pinsSettingsList, context)=>new SharpService().tint(params, pinsSettingsList, context);
|
|
189
203
|
const modulate = (params, pinsSettingsList, context)=>new SharpService().modulate(params, pinsSettingsList, context);
|
|
@@ -204,6 +218,7 @@ exports.flip = flip;
|
|
|
204
218
|
exports.flop = flop;
|
|
205
219
|
exports.grayscale = grayscale;
|
|
206
220
|
exports.jpeg = jpeg;
|
|
221
|
+
exports.linear = linear;
|
|
207
222
|
exports.metadata = metadata;
|
|
208
223
|
exports.modulate = modulate;
|
|
209
224
|
exports.negate = negate;
|
|
@@ -213,6 +228,7 @@ exports.resize = resize;
|
|
|
213
228
|
exports.rotate = rotate;
|
|
214
229
|
exports.sharpen = sharpen;
|
|
215
230
|
exports.stats = stats;
|
|
231
|
+
exports.threshold = threshold;
|
|
216
232
|
exports.tint = tint;
|
|
217
233
|
exports.toFormat = toFormat;
|
|
218
234
|
exports.webp = webp;
|
package/index.esm.js
CHANGED
|
@@ -32,9 +32,9 @@ let SharpService = class SharpService {
|
|
|
32
32
|
return buffer.toString('base64');
|
|
33
33
|
}
|
|
34
34
|
async resize(params, _pinsSettingsList, _context) {
|
|
35
|
-
const { content, width, height } = params;
|
|
35
|
+
const { content, width, height, options = {} } = params;
|
|
36
36
|
const { image, mimeType } = await this.loadImage(content);
|
|
37
|
-
image.resize(width, height);
|
|
37
|
+
image.resize(width, height, options);
|
|
38
38
|
return this.toBase64(image, mimeType);
|
|
39
39
|
}
|
|
40
40
|
async rotate(params, _pinsSettingsList, _context) {
|
|
@@ -76,6 +76,18 @@ let SharpService = class SharpService {
|
|
|
76
76
|
image.grayscale();
|
|
77
77
|
return this.toBase64(image, mimeType);
|
|
78
78
|
}
|
|
79
|
+
async linear(params, _pinsSettingsList, _context) {
|
|
80
|
+
const { content, multiplier, offset } = params;
|
|
81
|
+
const { image, mimeType } = await this.loadImage(content);
|
|
82
|
+
image.linear(multiplier, offset);
|
|
83
|
+
return this.toBase64(image, mimeType);
|
|
84
|
+
}
|
|
85
|
+
async threshold(params, _pinsSettingsList, _context) {
|
|
86
|
+
const { content, level = 128, option = {} } = params;
|
|
87
|
+
const { image, mimeType } = await this.loadImage(content);
|
|
88
|
+
image.threshold(level, option);
|
|
89
|
+
return this.toBase64(image, mimeType);
|
|
90
|
+
}
|
|
79
91
|
async negate(params, _pinsSettingsList, _context) {
|
|
80
92
|
const { content } = params;
|
|
81
93
|
const { image, mimeType } = await this.loadImage(content);
|
|
@@ -176,6 +188,8 @@ const extract = (params, pinsSettingsList, context)=>new SharpService().extract(
|
|
|
176
188
|
const flip = (params, pinsSettingsList, context)=>new SharpService().flip(params, pinsSettingsList, context);
|
|
177
189
|
const flop = (params, pinsSettingsList, context)=>new SharpService().flop(params, pinsSettingsList, context);
|
|
178
190
|
const grayscale = (params, pinsSettingsList, context)=>new SharpService().grayscale(params, pinsSettingsList, context);
|
|
191
|
+
const linear = (params, pinsSettingsList, context)=>new SharpService().linear(params, pinsSettingsList, context);
|
|
192
|
+
const threshold = (params, pinsSettingsList, context)=>new SharpService().threshold(params, pinsSettingsList, context);
|
|
179
193
|
const negate = (params, pinsSettingsList, context)=>new SharpService().negate(params, pinsSettingsList, context);
|
|
180
194
|
const tint = (params, pinsSettingsList, context)=>new SharpService().tint(params, pinsSettingsList, context);
|
|
181
195
|
const modulate = (params, pinsSettingsList, context)=>new SharpService().modulate(params, pinsSettingsList, context);
|
|
@@ -188,4 +202,4 @@ const webp = (params, pinsSettingsList, context)=>new SharpService().webp(params
|
|
|
188
202
|
const avif = (params, pinsSettingsList, context)=>new SharpService().avif(params, pinsSettingsList, context);
|
|
189
203
|
const composite = (params, pinsSettingsList, context)=>new SharpService().composite(params, pinsSettingsList, context);
|
|
190
204
|
|
|
191
|
-
export { avif, blur, composite, extract, flip, flop, grayscale, jpeg, metadata, modulate, negate, png, raw, resize, rotate, sharpen, stats, tint, toFormat, webp };
|
|
205
|
+
export { avif, blur, composite, extract, flip, flop, grayscale, jpeg, linear, metadata, modulate, negate, png, raw, resize, rotate, sharpen, stats, threshold, tint, toFormat, webp };
|
|
@@ -8,6 +8,8 @@ export declare const extract: (params: any, pinsSettingsList: PinsSettings[], co
|
|
|
8
8
|
export declare const flip: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<string>;
|
|
9
9
|
export declare const flop: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<string>;
|
|
10
10
|
export declare const grayscale: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<string>;
|
|
11
|
+
export declare const linear: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<string>;
|
|
12
|
+
export declare const threshold: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<string>;
|
|
11
13
|
export declare const negate: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<string>;
|
|
12
14
|
export declare const tint: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<string>;
|
|
13
15
|
export declare const modulate: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<string>;
|