···88import {ActionCrop, FlipType, SaveFormat} from 'expo-image-manipulator'
99import {Position} from 'react-avatar-editor'
1010import {Dimensions} from 'lib/media/types'
1111+import {isIOS} from 'platform/detection'
11121213export interface ImageManipulationAttributes {
1314 aspectRatio?: '4:3' | '1:1' | '3:4' | 'None'
···164165 // Mobile
165166 async crop() {
166167 try {
167167- // openCropper requires an output width and height hence
168168- // getting upload dimensions before cropping is necessary.
168168+ // NOTE
169169+ // on ios, react-native-image-cropper gives really bad quality
170170+ // without specifying width and height. on android, however, the
171171+ // crop stretches incorrectly if you do specify it. these are
172172+ // both separate bugs in the library. we deal with that by
173173+ // providing width & height for ios only
174174+ // -prf
169175 const {width, height} = this.getUploadDimensions({
170176 width: this.width,
171177 height: this.height,
···175181 mediaType: 'photo',
176182 path: this.path,
177183 freeStyleCropEnabled: true,
178178- width,
179179- height,
184184+ ...(isIOS ? {width, height} : {}),
180185 })
181186182187 runInAction(() => {