koishi-plugin-starfx-bot 0.4.0 → 0.4.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.
package/lib/index.js CHANGED
@@ -188,7 +188,7 @@ async function drawLock(ctx, baseImage) {
188
188
  const size1 = Math.min(imageMetadata.width, imageMetadata.height);
189
189
  image.resize({ width: size1, height: size1, fit: "cover" });
190
190
  const overlay = (0, import_sharp.default)(lockUrl).png();
191
- overlay.resize({ width: imageMetadata.width });
191
+ overlay.resize({ width: size1 });
192
192
  image.composite([{ input: await overlay.toBuffer() }]);
193
193
  return import_koishi.h.image(await image.png().toBuffer(), "image/png");
194
194
  }
@@ -213,7 +213,7 @@ async function drawSold(ctx, baseImage) {
213
213
  }).png();
214
214
  const soldUrl = `${assetsDir}/sold.png`;
215
215
  const overlay = (0, import_sharp.default)(soldUrl).png();
216
- const overlaySize = Math.round(imageMetadata.width * 182 / 240);
216
+ const overlaySize = Math.round(size1 * 182 / 240);
217
217
  overlay.resize({
218
218
  width: overlaySize,
219
219
  height: overlaySize
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "contributors": [
5
5
  "StarFreedomX <starfreedomx@outlook.com>"
6
6
  ],
7
- "version": "0.4.0",
7
+ "version": "0.4.1",
8
8
  "main": "lib/index.js",
9
9
  "typings": "lib/index.d.ts",
10
10
  "files": [
package/readme.md CHANGED
@@ -23,3 +23,5 @@ StarFreedomX机器人的小功能,自用
23
23
  | `0.3.4` | 分离"艾特我/他又不说话"的两个选项为单独的开关 |
24
24
  | `0.3.5` | 修复丢失的assets |
25
25
  | `0.3.6` | 添加"艾特我/他又不说话"的概率配置 |
26
+ | `0.4.0` | 更改处理库为sharp |
27
+ | `0.4.1` | 修复sharp处理w>h的图报错的bug |
package/assets/lock.png DELETED
Binary file
package/assets/sold.png DELETED
Binary file