@ryuu-reinzz/haruka-lib 2.0.5 → 2.0.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.
@@ -1,7 +1,7 @@
1
1
  import fs from 'fs-extra';
2
2
  import axios from 'axios';
3
3
  import Utils, { defaultBg } from './Utils.js';
4
- import { fromBuffer } from 'file-type';
4
+ import pkg from 'file-type';
5
5
  import convert from './internal/convert.js';
6
6
  import Exif from './internal/Metadata/Exif.js';
7
7
  import { StickerTypes } from './internal/Metadata/StickerTypes.js';
@@ -9,6 +9,7 @@ import { extractMetadata } from './index.js';
9
9
  /**
10
10
  * Sticker class
11
11
  */
12
+ const { fromBuffer } = pkg;
12
13
  export class Sticker {
13
14
  /**
14
15
  * Sticker Constructor
@@ -1,10 +1,11 @@
1
- import { Image } from 'node-webpmux';
1
+ import webp from 'node-webpmux';
2
2
  /**
3
3
  * Extracts metadata from a WebP image.
4
4
  * @param {Buffer}image - The image buffer to extract metadata from
5
5
  */
6
- export const extractMetadata = async (image) => {
7
- const img = new Image();
6
+ const WebP = webp;
7
+ export const extractMetapdata = async (image) => {
8
+ const img = new WebP();
8
9
  await img.load(image);
9
10
  const exif = img.exif?.toString('utf-8') ?? '{}';
10
11
  return JSON.parse(exif.substring(exif.indexOf('{'), exif.lastIndexOf('}') + 1) ?? '{}');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuu-reinzz/haruka-lib",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "Library extra for bot WhatsApp",
5
5
  "main": "main/index.js",
6
6
  "type": "module",