ivpusic / react-native-image-crop-picker

iOS/Android image picker with support for camera, video, configurable compression, multiple images and cropping
MIT License
6.09k stars 1.55k forks source link

How does cropping work on iOS? I can't crop... #1262

Open antoinerousseau opened 4 years ago

antoinerousseau commented 4 years ago

Version

Tell us which versions you are using:

Platform

Tell us to which platform this issue is related

Expected behaviour

I would like to be able to crop a photo after taking it, in both Android and iOS.

Actual behaviour

After taking a photo in Android with openCamera and cropping: true I have access to a cropping UI and all works well, the promise resolves to a cropped photo.

But in iOS (iPhone 8 Plus, real device) it only opens the default camera and does not take me to the cropper once the photo is taken. I also tried with openPicker in the iPhone simulator and it's the same: I can pick the photo but not crop it afterwards:

Capture d'écran 2020-04-07 14 21 39

Steps to reproduce

Here is my code:

import ImagePicker, { Options, Image } from "react-native-image-crop-picker"

import { getPermissions } from "src/helpers/permissions"
import COLORS from "src/constants/colors"

const OPTIONS: Options = {
  mediaType: "photo",
  compressImageQuality: 0.8,
  cropping: true,
  freeStyleCropEnabled: true,
  showCropGuidelines: false,
  forceJpg: true,
  cropperActiveWidgetColor: COLORS.red,
}

export const pickPhoto = async (size: number): Promise<Image> => {
  const granted = await getPermissions(["camera", "write"])

  if (!granted) {
    throw new Error("Missing permissions")
  }

  const response = await ImagePicker.openCamera({
    ...OPTIONS,
    compressImageMaxWidth: size,
    compressImageMaxHeight: size,
  })

  return response as Image
}

Did I miss something?

quyenlt1812 commented 4 years ago

At the picture you show above, you can use your gesture (2 fingers) to zoom in and moving the picture to get the cropping area

garmire commented 4 years ago

@antoinerousseau using option cropperToolbarTitle: 'Move and Scale' reduced my confusion.

LouisLeung commented 3 years ago

same issues

Version

react-native-image-crop-picker v0.24.1 react-native-cli: 2.0.1 react-native: 0.59.9

muralitharanaspritle commented 1 year ago

Same issue

Version

React-native - 0.60.5 react-native-image-crop-picker v0.25.3