@ryuu-reinzz/haruka-lib 3.7.0 → 3.7.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.
@@ -1,6 +1,6 @@
1
1
  import fs from 'fs-extra'
2
2
  import path from 'path'
3
- import webp from 'node-webpmux'
3
+ import bin from 'node-webpmux'
4
4
  import ffmpeg from 'fluent-ffmpeg'
5
5
  import Crypto from 'crypto'
6
6
  import {
@@ -9,7 +9,7 @@ import {
9
9
 
10
10
  async function imageToWebp(media) {
11
11
  const tmpFileOut = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.webp`);
12
- const tmpFileIn = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.jpg`);
12
+ const tmpFileIn = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.bin`);
13
13
  await fs.writeFile(tmpFileIn, media);
14
14
 
15
15
  await new Promise((resolve, reject) => {
@@ -20,7 +20,7 @@ async function imageToWebp(media) {
20
20
  '-vcodec',
21
21
  'libwebp',
22
22
  '-vf',
23
- "scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:color=white@0.0, split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse"
23
+ "scale='min(320,iw)':'min(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:color=white@0.0, split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse"
24
24
  ])
25
25
  .toFormat('webp')
26
26
  .save(tmpFileOut);
@@ -34,12 +34,12 @@ async function imageToWebp(media) {
34
34
 
35
35
  export async function stickerImg(media, metadata) {
36
36
  const wMedia = await imageToWebp(media);
37
- const tmpFileIn = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.webp`);
37
+ const tmpFileIn = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.bin`);
38
38
  const tmpFileOut = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.webp`);
39
39
  await fs.writeFile(tmpFileIn, wMedia);
40
40
 
41
41
  if (metadata.packname || metadata.author) {
42
- const img = new webp.Image();
42
+ const img = new bin.Image();
43
43
  const json = {
44
44
  'sticker-pack-id': 'https://www.npmjs.com/package/@ryuu-reinzz/baileys',
45
45
  'sticker-pack-name': metadata.packname,
@@ -17,7 +17,7 @@ async function videoToWebp(media) {
17
17
  return media;
18
18
  }
19
19
  const tmpFileOut = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.webp`);
20
- const tmpFileIn = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.mp4`);
20
+ const tmpFileIn = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.bin`);
21
21
  await fs.writeFile(tmpFileIn, media);
22
22
 
23
23
  await new Promise((resolve, reject) => {
@@ -28,7 +28,7 @@ async function videoToWebp(media) {
28
28
  '-vcodec',
29
29
  'libwebp',
30
30
  '-vf',
31
- "scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:color=white@0.0, split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse",
31
+ "scale='min(320,iw)':'min(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:color=white@0.0, split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse",
32
32
  '-loop',
33
33
  '0',
34
34
  '-ss',
@@ -53,7 +53,7 @@ async function videoToWebp(media) {
53
53
 
54
54
  export async function stickerVid(media, metadata) {
55
55
  const wMedia = await videoToWebp(media);
56
- const tmpFileIn = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.webp`);
56
+ const tmpFileIn = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.bin`);
57
57
  const tmpFileOut = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.webp`);
58
58
  await fs.writeFile(tmpFileIn, wMedia);
59
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuu-reinzz/haruka-lib",
3
- "version": "3.7.0",
3
+ "version": "3.7.1",
4
4
  "description": "Library extra for bot WhatsApp",
5
5
  "main": "main/index.js",
6
6
  "type": "module",