koishi-plugin-checkgal 1.2.1 → 1.3.0

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.
Files changed (2) hide show
  1. package/lib/api.js +5 -3
  2. package/package.json +2 -4
package/lib/api.js CHANGED
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.TouchGalAPI = void 0;
4
- const Jimp = require('jimp');
7
+ const sharp_1 = __importDefault(require("sharp"));
5
8
  class TouchGalAPI {
6
9
  constructor(ctx) {
7
10
  this.http = ctx.http;
@@ -68,8 +71,7 @@ class TouchGalAPI {
68
71
  });
69
72
  if (!(response instanceof ArrayBuffer))
70
73
  return null;
71
- const image = await Jimp.read(Buffer.from(response));
72
- return await image.getBufferAsync('image/jpeg');
74
+ return (0, sharp_1.default)(Buffer.from(response)).jpeg().toBuffer();
73
75
  }
74
76
  catch (error) {
75
77
  this.logger.error(`Failed to download or convert image from ${url}:`, error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koishi-plugin-checkgal",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "个人测试请勿使用",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -26,8 +26,6 @@
26
26
  "typescript": "^5.9.3"
27
27
  },
28
28
  "dependencies": {
29
- "@jimp/core": "^1.6.0",
30
- "@jimp/wasm-avif": "^1.6.0",
31
- "jimp": "^1.6.0"
29
+ "sharp": "^0.34.4"
32
30
  }
33
31
  }