mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-20 13:40:10 +08:00
fix: pic size
This commit is contained in:
parent
f2ee973882
commit
40e105994a
@ -3,12 +3,12 @@ import { PicType } from '../types';
|
|||||||
export async function getFileTypeForSendType(picPath: string): Promise<PicType> {
|
export async function getFileTypeForSendType(picPath: string): Promise<PicType> {
|
||||||
const fileTypeResult = (await fileType.fileTypeFromFile(picPath))?.ext ?? 'jpg';
|
const fileTypeResult = (await fileType.fileTypeFromFile(picPath))?.ext ?? 'jpg';
|
||||||
const picTypeMap: { [key: string]: PicType } = {
|
const picTypeMap: { [key: string]: PicType } = {
|
||||||
'webp': PicType.NEWPIC_WEBP,
|
//'webp': PicType.NEWPIC_WEBP,
|
||||||
'gif': PicType.NEWPIC_GIF,
|
'gif': PicType.NEWPIC_GIF,
|
||||||
'png': PicType.NEWPIC_APNG,
|
// 'png': PicType.NEWPIC_APNG,
|
||||||
'jpg': PicType.NEWPIC_JPEG,
|
// 'jpg': PicType.NEWPIC_JPEG,
|
||||||
'jpeg': PicType.NEWPIC_JPEG,
|
// 'jpeg': PicType.NEWPIC_JPEG,
|
||||||
'bmp': PicType.NEWPIC_BMP,
|
// 'bmp': PicType.NEWPIC_BMP,
|
||||||
};
|
};
|
||||||
return picTypeMap[fileTypeResult] ?? PicType.NEWPIC_JPEG;
|
return picTypeMap[fileTypeResult] ?? PicType.NEWPIC_JPEG;
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user