Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ImagePicker = NativeModules.ImageCropPicker;
- pickSingleWithCamera(cropIt) {
- ImagePicker.openCamera({
- cropping: cropIt,
- width: 500,
- height: 500,
- includeExif: true
- })
- .then(image => {
- console.log("received image", image);
- this.setState({
- image: { uri: image.path, width: image.width, height: image.height }
- });
- })
- .catch(e => alert(e));
- }
- pickSingle(cropIt) {
- ImagePicker.openPicker({
- width: 300,
- height: 300,
- cropping: cropIt,
- compressImageMaxWidth: 640,
- compressImageMaxHeight: 480,
- compressImageQuality: 0.5,
- compressVideoPreset: "MediumQuality",
- includeExif: true
- })
- .then(image => {
- console.log("received image", image);
- this.setState({
- image: {
- uri: image.path,
- width: image.width,
- height: image.height,
- mime: image.mime
- }
- });
- })
- .catch(e => {
- console.log(e);
- Alert.alert(e.message ? e.message : e);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement