From 6a000b318492759ffc0293b07c63a4dcb5640794 Mon Sep 17 00:00:00 2001 From: tamaina Date: Mon, 31 Jan 2022 01:36:52 +0900 Subject: [PATCH] =?UTF-8?q?jpeg,=20png=E3=81=AB=E3=82=82=E3=81=A9=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/client/src/scripts/upload.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/client/src/scripts/upload.ts b/packages/client/src/scripts/upload.ts index 4e37a5ddc..e3dbbf5dc 100644 --- a/packages/client/src/scripts/upload.ts +++ b/packages/client/src/scripts/upload.ts @@ -14,17 +14,22 @@ type Uploading = { export const uploads = ref([]); const compressTypeMap = { - 'image/jpeg': { quality: 0.85, mimeType: 'image/webp'}, - 'image/webp': { quality: 0.85, mimeType: 'image/webp'}, - 'image/png': { quality: 1, mimeType: 'image/webp'}, - 'image/svg+xml': { quality: 1, mimeType: 'image/webp'}, + 'image/jpeg': { quality: 0.85, mimeType: 'image/jpeg'}, + 'image/webp': { quality: 0.85, mimeType: 'image/jpeg'}, + 'image/png': { quality: 1, mimeType: 'image/png'}, + 'image/svg+xml': { quality: 1, mimeType: 'image/png'}, } as const; const mimeTypeMap = { 'image/webp': 'webp', } as const; -export function uploadFile(file: File, folder?: any, name?: string, keepOriginal: boolean = defaultStore.state.keepOriginalUploading): Promise { +export function uploadFile( + file: File, + folder?: any, + name?: string, + keepOriginal: boolean = defaultStore.state.keepOriginalUploading +): Promise { if (folder && typeof folder == 'object') folder = folder.id; return new Promise((resolve, reject) => {