How to use the react-native-image-crop-picker.openCropper function in react-native-image-crop-picker

To help you get started, we’ve selected a few react-native-image-crop-picker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mongrov / roverz / src / chat / ui / room / RoomView.js View on Github external
.then((images) => {
      console.log('LogOut - imagemap', this._network.service.loggedInUser);
      console.log('PM - images', images);
      if (images && images.length > 0) {
        if (images.length === 1 && images[0].mime !== 'image/gif' && Platform.OS !== 'ios') {
          console.log('LogOut - singleimageselection', this._network.service.loggedInUser);
          // Cropper
          ImagePicker.openCropper({
            path: images[0].path,
            width: 1000,
            height: 1000,
          }).then((data) => {
            console.log('LogOut - singleimagecrop', this._network.service.loggedInUser);
            console.log('PM - data', data);
            const _progressCallback = this._progressCallback;
            new ImageUtil().uploadImage(data, this._group._id, true, 'Image',
            (fuFileName, fuPercent, fuMsg) => {
              console.log(fuFileName, ':', fuPercent, ':', fuMsg);
              const fileNameCount = fuFileName;
              console.log('LogOut - roomview', this._network.service.loggedInUser);
              const percentage = Math.round(Number(parseFloat(fuPercent).toFixed(2) * 100));
              if (_progressCallback) {
                _progressCallback(fileNameCount, fuMsg, percentage, 1, 0);
              }
github Mangeneh / akkaskhooneh-frontend / src / pages / newPost / NewPost.js View on Github external
openPicker() {
    ImagePicker.openCropper({
      path: this.state.imageSource,
      width: Constants.UPLOAD_POST_PICTURE_SIZE,
      height: Constants.UPLOAD_POST_PICTURE_SIZE,
      cropperStatusBarColor: Colors.BASE,
      cropperToolbarColor: Colors.BASE,
    }).then((image) => {
      const imageSource = extractImageSource(image);
      this.setState({
        imageSource,
        hasChosen: true,
      });
      this.continue();
    });
  }