diff options
author | hailey <me@haileyok.com> | 2025-05-06 10:54:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-06 10:54:08 -0700 |
commit | 521ec8e044e58633530e1864e7abc6e22554d7d3 (patch) | |
tree | e57139a4cfcb9f8859f5e1af008740fc3e8306e3 /src/state/gallery.ts | |
parent | 973538d246a3f76550611e438152f1a6cad75f49 (diff) | |
download | voidsky-521ec8e044e58633530e1864e7abc6e22554d7d3.tar.zst |
swap out cropper library (#8327)
* mostly implement * type errors * unused import * rm comment * stop accidentally deleting the image while compressing * upgrade * type fixes * upgrade, remove timeout * bump * rm mock * bump --------- Co-authored-by: Samuel Newman <mozzius@protonmail.com>
Diffstat (limited to 'src/state/gallery.ts')
-rw-r--r-- | src/state/gallery.ts | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/state/gallery.ts b/src/state/gallery.ts index f03ed2afe..73252dde7 100644 --- a/src/state/gallery.ts +++ b/src/state/gallery.ts @@ -16,7 +16,7 @@ import {POST_IMG_MAX} from '#/lib/constants' import {getImageDim} from '#/lib/media/manip' import {openCropper} from '#/lib/media/picker' import {getDataUriSize} from '#/lib/media/util' -import {isIOS, isNative} from '#/platform/detection' +import {isNative} from '#/platform/detection' export type ImageTransformation = { crop?: ActionCrop['crop'] @@ -122,25 +122,13 @@ export async function cropImage(img: ComposerImage): Promise<ComposerImage> { return img } - // NOTE - // on ios, react-native-image-crop-picker gives really bad quality - // without specifying width and height. on android, however, the - // crop stretches incorrectly if you do specify it. these are - // both separate bugs in the library. we deal with that by - // providing width & height for ios only - // -prf - const source = img.source - const [w, h] = containImageRes(source.width, source.height, POST_IMG_MAX) // @todo: we're always passing the original image here, does image-cropper // allows for setting initial crop dimensions? -mary try { const cropped = await openCropper({ - mediaType: 'photo', - path: source.path, - freeStyleCropEnabled: true, - ...(isIOS ? {width: w, height: h} : {}), + imageUri: source.path, }) return { |