@shibam/sticker-maker 1.1.8 → 1.1.9
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/lib/ToWebp.js +4 -4
- package/package.json +1 -1
package/dist/lib/ToWebp.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import sharp
|
|
1
|
+
import sharp from 'sharp';
|
|
2
2
|
import { StickerTypes } from '../types/StickerTypes.js';
|
|
3
3
|
import toGif from './toGif.js';
|
|
4
4
|
/**
|
|
@@ -21,7 +21,7 @@ const ToWebp = async (buffer, metaInfo, mimeExt, mimeType) => {
|
|
|
21
21
|
const res = sharp(data, { animated: isAnimated });
|
|
22
22
|
if (metaInfo.type === StickerTypes.CIRCLE) {
|
|
23
23
|
res.resize(512, 512, {
|
|
24
|
-
fit: fit.cover
|
|
24
|
+
fit: sharp.fit.cover
|
|
25
25
|
}).composite([
|
|
26
26
|
{
|
|
27
27
|
input: Buffer.from(`<svg width="512" height="512"><circle cx="256" cy="256" r="256" fill=""/></svg>`),
|
|
@@ -33,12 +33,12 @@ const ToWebp = async (buffer, metaInfo, mimeExt, mimeType) => {
|
|
|
33
33
|
}
|
|
34
34
|
else if (metaInfo.type === StickerTypes.SQUARE && !mimeType?.includes('video')) {
|
|
35
35
|
res.resize(512, 512, {
|
|
36
|
-
fit: fit.fill
|
|
36
|
+
fit: sharp.fit.fill
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
40
40
|
res.resize(512, 512, {
|
|
41
|
-
fit: fit.contain,
|
|
41
|
+
fit: sharp.fit.contain,
|
|
42
42
|
background: { r: 0, g: 0, b: 0, alpha: 0 }
|
|
43
43
|
});
|
|
44
44
|
}
|