♻️ Improved image analyzer in attachments

This commit is contained in:
2024-07-19 23:56:59 +08:00
parent 5a7432e330
commit 0573ee456e
3 changed files with 50 additions and 41 deletions

View File

@ -87,12 +87,14 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
try {
final file = File(image.path);
final hash = await calculateFileSha256(file);
final meta = await calculateImageMetaFromFile(file);
attachResp = await provider.createAttachment(
await file.readAsBytes(),
file.path,
hash,
'p.$position',
ratio: await calculateFileAspectRatio(file),
{...meta},
);
} catch (e) {
setState(() => _isBusy = false);