From 690c0733289b9cc9d30c1bfbd8704ed1bd669251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Mon, 12 May 2025 19:27:01 +0800 Subject: [PATCH] fix --- src/image-size/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/image-size/index.ts b/src/image-size/index.ts index 66109f05..c86ecd09 100644 --- a/src/image-size/index.ts +++ b/src/image-size/index.ts @@ -192,7 +192,9 @@ class BmpParser implements ImageParser { stream.once('error', reject); stream.once('readable', () => { const buf = stream.read(26) as Buffer; - if (!buf || buf.length < 26) return resolve(undefined); + if (!buf || buf.length < 26) { + return resolve(undefined); + } if (this.canParse(buf)) { const width = buf.readUInt32LE(18); const height = buf.readUInt32LE(22);