@wahaha216/koishi-plugin-jmcomic 0.2.1 → 0.2.2
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 +4 -0
- package/package.json +1 -1
- package/readme.md +7 -0
package/lib/index.js
CHANGED
|
@@ -652,6 +652,10 @@ async function decodeImage(imageBuffer, num, path) {
|
|
|
652
652
|
const metadata = await (0, import_sharp.default)(Buffer.from(imageBuffer)).metadata();
|
|
653
653
|
const height = metadata.height || 0;
|
|
654
654
|
const width = metadata.width || 0;
|
|
655
|
+
if (height < num) {
|
|
656
|
+
await (0, import_sharp.default)(Buffer.from(imageBuffer)).toFile(path);
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
655
659
|
const over = height % num;
|
|
656
660
|
const move = Math.floor(height / num);
|
|
657
661
|
let decodedImageInstance = (0, import_sharp.default)({
|
package/package.json
CHANGED