chore: improve image edit

This commit is contained in:
jialin
2025-02-17 13:49:55 +08:00
parent 384a75622f
commit d2a3388058
13 changed files with 214 additions and 86 deletions
+8
View File
@@ -166,3 +166,11 @@ export const extractErrorMessage = (result: any) => {
''
);
};
export const scaleImageSize = (size: { width: number; height: number }) => {
const { width, height } = size;
const scale = 64;
const newWidth = Math.floor(width / scale) * scale;
const newHeight = Math.floor(height / scale) * scale;
return { width: newWidth, height: newHeight };
};