@shibam/sticker-maker 1.2.7 → 1.2.8
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.js +6 -9
- package/package.json +2 -5
- package/utils/convert.js +3 -3
package/index.js
CHANGED
|
@@ -98,13 +98,10 @@ export default class Sticker {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
async build() {
|
|
101
|
-
// Process input to buffer
|
|
102
101
|
const inputBuffer = await this.processImage(this.image);
|
|
103
102
|
|
|
104
|
-
// Convert to WebP using imported converter
|
|
105
103
|
const webpBuffer = await this.converter.convertToWebp(inputBuffer);
|
|
106
104
|
|
|
107
|
-
// Add metadata using imported Exif handler
|
|
108
105
|
const exif = new Exif({
|
|
109
106
|
id: this.id,
|
|
110
107
|
pack: this.pack,
|
|
@@ -120,11 +117,11 @@ export default class Sticker {
|
|
|
120
117
|
return await this.build();
|
|
121
118
|
}
|
|
122
119
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return await extractMetadata(this.buffer);
|
|
120
|
+
async metadata() {
|
|
121
|
+
if (!this.buffer) {
|
|
122
|
+
await this.build();
|
|
129
123
|
}
|
|
124
|
+
|
|
125
|
+
return await extractMetadata(this.buffer);
|
|
126
|
+
}
|
|
130
127
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shibam/sticker-maker",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -11,11 +11,8 @@
|
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"description": "",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"cwebp": "^3.1.0",
|
|
15
14
|
"file-type": "^20.0.0",
|
|
16
|
-
"jimp": "^1.6.0",
|
|
17
15
|
"node-webpmux": "^3.2.0",
|
|
18
|
-
"sharp": "0.
|
|
19
|
-
"webp-converter": "^2.3.3"
|
|
16
|
+
"sharp": "^0.33.5"
|
|
20
17
|
}
|
|
21
18
|
}
|
package/utils/convert.js
CHANGED
|
@@ -10,9 +10,9 @@ const exec = promisify(execCallback);
|
|
|
10
10
|
|
|
11
11
|
export default class MediaConverter {
|
|
12
12
|
constructor(options = {}) {
|
|
13
|
-
this.fps =
|
|
14
|
-
this.quality = options.quality
|
|
15
|
-
this.width = options.width
|
|
13
|
+
this.fps = 12;
|
|
14
|
+
this.quality = options.quality ?? 10;
|
|
15
|
+
this.width = options.width ?? 320;
|
|
16
16
|
this.mime = null;
|
|
17
17
|
}
|
|
18
18
|
|