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)
This commit is contained in:
parent
6325eff938
commit
d87c232660
4 changed files with 21 additions and 7 deletions
|
@ -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},
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue