chore: image edit api

This commit is contained in:
jialin
2024-12-30 08:37:58 +08:00
parent cb98812444
commit 0b423a6fe0
10 changed files with 125 additions and 29 deletions
+2
View File
@@ -45,6 +45,7 @@ const AutoImage: React.FC<
return;
}
const { ratio } = await getImgRatio(props.src || '');
console.log('ratio', ratio);
if (typeof height === 'number') {
setWidth(height * ratio);
} else {
@@ -66,6 +67,7 @@ const AutoImage: React.FC<
const handleImgLoad = useCallback(() => {
props.onLoad?.();
setIsError(false);
}, [props.onLoad]);
const handleOnError = () => {