@baileys-md/baileys 12.3.0 → 12.3.1
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.
|
@@ -91,14 +91,26 @@ const extractVideoThumb = async (path, destPath, time, size) => new Promise((res
|
|
|
91
91
|
});
|
|
92
92
|
//=======================================================//
|
|
93
93
|
export const extractImageThumb = async (bufferOrFilePath, width = 32) => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
94
|
+
if (bufferOrFilePath instanceof Readable) bufferOrFilePath = await toBuffer(bufferOrFilePath);
|
|
95
|
+
const {
|
|
96
|
+
read,
|
|
97
|
+
MIME_JPEG,
|
|
98
|
+
RESIZE_BILINEAR,
|
|
99
|
+
AUTO
|
|
100
|
+
} = Jimp;
|
|
101
|
+
const jimp = await read(bufferOrFilePath);
|
|
102
|
+
const dimensions = {
|
|
103
|
+
width: jimp.getWidth(),
|
|
104
|
+
height: jimp.getHeight()
|
|
105
|
+
};
|
|
106
|
+
const buffer = await jimp
|
|
107
|
+
.quality(50)
|
|
108
|
+
.resize(width, AUTO, RESIZE_BILINEAR)
|
|
109
|
+
.getBufferAsync(MIME_JPEG);
|
|
110
|
+
return {
|
|
111
|
+
buffer,
|
|
112
|
+
original: dimensions
|
|
113
|
+
};
|
|
102
114
|
};
|
|
103
115
|
//=======================================================//
|
|
104
116
|
export const encodeBase64EncodedStringForUpload = (b64) => encodeURIComponent(b64.replace(/\+/g, "-").replace(/\//g, "_").replace(/\=+$/, ""));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baileys-md/baileys",
|
|
3
|
-
"version": "12.3.
|
|
3
|
+
"version": "12.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Forked from Baileys core adaptado para @sixcore/baileys",
|
|
6
6
|
"keywords": ["whatsapp","js-whatsapp","whatsapp-api","whatsapp-web","WhiskeySockets", "@whiskeysockets","whiskeysockets", "@whiskey", "sockets","socket","@whiskeysockets/baileys","whatsapp","whatsapp-chat","whatsapp-group","baileys","baileys-md", "newsletter","news letter" , "automation","multi-device","ttdl","tiktok","tiktok scraper","tiktok no watermark","tiktok no wm","ttnowm","ytdl","ytmp3","ytmp4","youtube","instagram","instagram-dl","igdl"],
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"axios": "1.3.2",
|
|
24
24
|
"jimp": "0.16.2",
|
|
25
25
|
"cache-manager": "^7.2.8",
|
|
26
|
-
"libsignal-xeuka": "npm:@
|
|
26
|
+
"libsignal-xeuka": "npm:@baileys-md/libsignal",
|
|
27
27
|
"long": "^5.3.2",
|
|
28
28
|
"lru-cache": "^10.2.0",
|
|
29
29
|
"music-metadata": "^7.14.0",
|