Xu ly dong bo nguoi dung thanh cong

This commit is contained in:
quangdn-ght
2025-06-26 00:47:54 +07:00
parent ee25e4ac82
commit 8af4d7a6d9
14 changed files with 113 additions and 66 deletions

View File

@@ -35,10 +35,10 @@ export function compressImage(file: Blob, maxSize: number): Promise<string> {
if (dataUrl.length < maxSize) break;
if (quality > 0.5) {
// Prioritize quality reduction
// Ưu tiên giảm chất lượng
quality -= 0.1;
} else {
// Then reduce the size
// Sau đó giảm kích thước
width *= 0.9;
height *= 0.9;
}