react-native-image-crop-picker icon indicating copy to clipboard operation
react-native-image-crop-picker copied to clipboard

Default crop area on iOS

Open GaylordP opened this issue 3 years ago • 9 comments

Version

Tell us which versions you are using:

  • react-native-image-crop-picker ^0.37.3
  • react-native 0.68.2

Platform

Tell us to which platform this issue is related

  • iOS

Expected behaviour

Hello :)

Thanks you very much for your library

When cropping and exclusively with iOS, the default crop area is truncated.

I found many topics about this (Link 1, Link 2, Link 3, etc.) and they are all "Closed" while the messages seem to say that the problem remains.

Here is my code :

  ImagePicker.openCropper({
    mediaType: 'photo',
    path: `file://${  currentPhoto.path}`,
    cropping: true,
    width: Platform.OS === 'ios' ? currentPhoto.width : undefined, // = ORIGINAL WITH
    height: Platform.OS === 'ios' ? currentPhoto.height : undefined, // = ORIGINAL HEIGHT
    freeStyleCropEnabled: true,
    ...
  }).then((image) => {
    ...

Do you have a solution ?

Attachments

Default resize :

IMG_0628

Expected default resize :

IMG_0629

Love react-native-image-crop-picker? Please consider supporting our collective: 👉 https://opencollective.com/react-native-image-crop-picker/donate

GaylordP avatar Jul 06 '22 08:07 GaylordP

I'm having the same issue! Is there a way around this?

Maker-Mark avatar Feb 09 '23 15:02 Maker-Mark

Here's a complete example patch file to fix this issue for iOS, thanks @nabilfreeman for the fix above. I just added the typing into the patch too.

How to use:

  • Create and add this file to the root of your repo: patches/
  • add "postinstall": "patch-package", to your package.json inside scripts
  • add patch-package to your dependancies (npm i patch-package or yarn add patch package)
  • Reinstall dependancies(npm i or yarn) and the patch will run after the install
  • Now the default will be the entire image (as long as you dont have a screen larger than 2000x2000 px heh react-native-image-crop-picker+0.38.1.patch

Maker-Mark avatar Feb 09 '23 16:02 Maker-Mark

Hi, @Maker-Mark Thanks for your help simulator_screenshot_2AA09BCA-779C-4FB8-9910-0AB49C285290

But i am using the patch still it's not working like by default is square can you help or tell me what I am doing wrong.

girish54321 avatar May 11 '23 12:05 girish54321

@girish54321 Did you follow the steps? You can try:

  • Delete node_modules
  • Clear Metro cache
  • uninstall the app from device
  • try again.

Maker-Mark avatar May 11 '23 14:05 Maker-Mark

@Maker-Mark Thanks for quick response

I will try this steps

girish54321 avatar May 11 '23 15:05 girish54321

@Maker-Mark I tried following your steps. But patch didn't work.

anandkumar-omnipay avatar Aug 08 '23 12:08 anandkumar-omnipay

Dont know what to tell ya'll, it's working for me! Send me more specific issues and I'll try to help @anandkumar-omnipay

Maker-Mark avatar Aug 08 '23 20:08 Maker-Mark

I applied the patch and followed your steps, unfortunately this doesn't work 😞

abdi4 avatar Nov 21 '23 09:11 abdi4

Update: It looks like this patch only works for development builds, and not when you actually archive the app.

Maker-Mark avatar Nov 21 '23 15:11 Maker-Mark