mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-09 19:46:37 +08:00
Merge 9ebdb3239a
into afa1a4303b
This commit is contained in:
commit
43f55017b9
@ -39,7 +39,10 @@ export function compressImage(file: File, maxSize: number): Promise<string> {
|
|||||||
};
|
};
|
||||||
reader.onerror = reject;
|
reader.onerror = reject;
|
||||||
|
|
||||||
if (file.type.includes("heic")) {
|
if (
|
||||||
|
file.name.toLowerCase().endsWith(".heic") ||
|
||||||
|
file.type.includes("heic")
|
||||||
|
) {
|
||||||
heic2any({ blob: file, toType: "image/jpeg" })
|
heic2any({ blob: file, toType: "image/jpeg" })
|
||||||
.then((blob) => {
|
.then((blob) => {
|
||||||
reader.readAsDataURL(blob as Blob);
|
reader.readAsDataURL(blob as Blob);
|
||||||
@ -47,8 +50,8 @@ export function compressImage(file: File, maxSize: number): Promise<string> {
|
|||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
reject(e);
|
reject(e);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
reader.readAsDataURL(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
reader.readAsDataURL(file);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user