From d87c232660f215608c26280f4cfbd5af3948f9d1 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Wed, 27 Sep 2023 09:08:21 -0700 Subject: Improve image cropping on android and introduce aspect ratio field (#1525) * Fix image cropping on android * Store and use aspect ratio field in post images (close #1392) --- src/lib/api/index.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/lib/api/index.ts') diff --git a/src/lib/api/index.ts b/src/lib/api/index.ts index 4ecd32046..8a9389a18 100644 --- a/src/lib/api/index.ts +++ b/src/lib/api/index.ts @@ -133,10 +133,12 @@ export async function post(store: RootStoreModel, opts: PostOpts) { opts.onStateChange?.(`Uploading image #${images.length + 1}...`) await image.compress() const path = image.compressed?.path ?? image.path + const {width, height} = image.compressed || image const res = await uploadBlob(store, path, 'image/jpeg') images.push({ image: res.data.blob, alt: image.altText ?? '', + aspectRatio: {width, height}, }) } -- cgit 1.4.1