React-native-image-crop-picker: Do we plans to crop multiple images?

Created on 25 Sep 2019  路  3Comments  路  Source: ivpusic/react-native-image-crop-picker

Like on instagram, choose multiple images and crop them individually.

Most helpful comment

@Martian2Lee

This is possible. User would basically just select a few images, and then be prompted to crop them one at a time.

Here's how I achieved this w/ this library:

const currPhotos = []
ImagePicker.openPicker({
    cropping: false,
    multiple: true
})
.then(async images => {
    for(var i=0; i<images.length; i++) {
        const image = images[i]
        if(!image.didCancel && !image.error) {
            const cropped = await ImagePicker.openCropper({
                path: image.path,
                ...options
            })
            currPhotos.push(cropped.path)
        }
    }
    //do something with currPhotos, e.g. func(currPhotos)
})

All 3 comments

currently no

@Martian2Lee

This is possible. User would basically just select a few images, and then be prompted to crop them one at a time.

Here's how I achieved this w/ this library:

const currPhotos = []
ImagePicker.openPicker({
    cropping: false,
    multiple: true
})
.then(async images => {
    for(var i=0; i<images.length; i++) {
        const image = images[i]
        if(!image.didCancel && !image.error) {
            const cropped = await ImagePicker.openCropper({
                path: image.path,
                ...options
            })
            currPhotos.push(cropped.path)
        }
    }
    //do something with currPhotos, e.g. func(currPhotos)
})

@samuely4ng

This is a great code.
It was a problem I was worried about, but thanks to you, I was able to solve the problem well

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhangjunhou picture zhangjunhou  路  3Comments

pavsidhu picture pavsidhu  路  3Comments

equesteo picture equesteo  路  3Comments

manojshrimalla picture manojshrimalla  路  3Comments

tximpa91 picture tximpa91  路  3Comments