fix: image progress display

This commit is contained in:
jialin
2025-01-15 09:51:29 +08:00
parent 35991ff5d6
commit 9553aa944a
5 changed files with 58 additions and 23 deletions
+2 -1
View File
@@ -149,7 +149,8 @@ export const generateRandomNumber = () => {
};
function base64ToBlob(base64: string, contentType = '', sliceSize = 512) {
const byteCharacters = atob(base64.split(',')[1]); // 去掉 Base64 前缀部分
const base64Content = base64.replace(/^data:image\/(png|jpg);base64,/, '');
const byteCharacters = atob(base64Content);
const byteArrays = [];
for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {