fix: some png can not send

This commit is contained in:
linyuchen 2024-03-30 12:02:20 +08:00
parent 33688e9e5c
commit 23be081d29

View File

@ -63,7 +63,7 @@ export class SendMsgElementConstructor {
} }
static async pic(picPath: string, summary: string = "", subType: 0|1=0): Promise<SendPicElement> { static async pic(picPath: string, summary: string = "", subType: 0|1=0): Promise<SendPicElement> {
const {md5, fileName, path, fileSize, ext} = await NTQQFileApi.uploadFile(picPath, ElementType.PIC, subType); const {md5, fileName, path, fileSize} = await NTQQFileApi.uploadFile(picPath, ElementType.PIC, subType);
if (fileSize === 0) { if (fileSize === 0) {
throw "文件异常大小为0"; throw "文件异常大小为0";
} }
@ -73,7 +73,7 @@ export class SendMsgElementConstructor {
fileSize: fileSize.toString(), fileSize: fileSize.toString(),
picWidth: imageSize.width, picWidth: imageSize.width,
picHeight: imageSize.height, picHeight: imageSize.height,
fileName: md5 + ext, fileName: fileName,
sourcePath: path, sourcePath: path,
original: true, original: true,
picType: isGIF(picPath) ? PicType.gif : PicType.jpg, picType: isGIF(picPath) ? PicType.gif : PicType.jpg,