make aspect ratio logic reusable, optimizations

This commit is contained in:
mertalev
2024-11-17 10:45:19 -05:00
parent 60715059f7
commit 4d1d902773
4 changed files with 166 additions and 115 deletions
+10
View File
@@ -402,4 +402,14 @@ class AssetService {
return exifInfo?.description ?? "";
}
Future<double> getAspectRatio(Asset asset) async {
if (asset.isLocal) {
await asset.localAsync;
} else if (asset.isRemote) {
asset = await loadExif(asset);
}
return asset.aspectRatio ?? 1.0;
}
}