How to use the expo-image-manipulator.SaveFormat function in expo-image-manipulator

To help you get started, we’ve selected a few expo-image-manipulator 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 brunon80 / expo-image-crop / example / manipulator / ImageManipulator.js View on Github external
export default ImgManipulator


ImgManipulator.defaultProps = {
    onPictureChoosed: ({ uri, base64 }) => console.log('URI:', uri, base64),
    btnTexts: {
        crop: 'Crop',
        rotate: 'Rotate',
        done: 'Done',
        processing: 'Processing',
    },
    dragVelocity: 100,
    resizeVelocity: 50,
    saveOptions: {
        compress: 1,
        format: ImageManipulator.SaveFormat.PNG,
        base64: false,
    },
}

ImgManipulator.propTypes = {
    isVisible: PropTypes.bool.isRequired,
    onPictureChoosed: PropTypes.func,
    btnTexts: PropTypes.object,
    saveOptions: PropTypes.object,
    photo: PropTypes.object.isRequired,
    onToggleModal: PropTypes.func.isRequired,
    dragVelocity: PropTypes.number,
    resizeVelocity: PropTypes.number,
}
github wheatandcat / Peperomia / PeperomiaNative / src / components / pages / CreatePlan / Connected.tsx View on Github external
const check = (props.calendars || []).find(
        calendar => calendar.date === state.input.date
      );

      if (check) {
        Alert.alert('同じ日にスケジュールが既に登録されています');
        return;
      }
    }

    let image = '';
    if (state.image) {
      const manipResult = await ImageManipulator.manipulateAsync(
        state.image,
        [{ rotate: 0 }, { flip: ImageManipulator.FlipType.Vertical }],
        { compress: 1, format: ImageManipulator.SaveFormat.PNG, base64: true }
      );

      image = manipResult.base64 || '';
    }

    db.transaction((tx: SQLite.Transaction) => {
      const item: Item = {
        title: state.input.title,
        kind: state.kind || getKind(state.input.title),
        image,
      };

      insertItem(tx, item, save);
    });
  }, [
    props.calendars,
github expo / expo / apps / native-component-list / src / screens / ImageManipulatorScreen.tsx View on Github external
_rotate = async (deg: number) => {
    await this._manipulate([{ rotate: deg }], {
      format: ImageManipulator.SaveFormat.PNG,
    });
  }

expo-image-manipulator

Provides functions that let you manipulation images on the local file system, eg: resize, crop.

MIT
Latest version published 24 days ago

Package Health Score

92 / 100
Full package analysis