Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Image Picker] Images in iPhone Library not visible #341

Open
Bernardmyburgh5 opened this issue Jun 30, 2022 · 0 comments
Open

[Image Picker] Images in iPhone Library not visible #341

Bernardmyburgh5 opened this issue Jun 30, 2022 · 0 comments

Comments

@Bernardmyburgh5
Copy link

Bernardmyburgh5 commented Jun 30, 2022

Which platform(s) does your issue occur on?

  • iOS
  • iOS 15.5
  • device, iPhone

Please, provide the following version numbers that your issue occurs with:

  • CLI: 8.2.3
  • Package Dependencies
    "dependencies": {
    "@master.technology/websockets": "^2.0.4",
    "@nativescript-community/drawingpad": "^4.1.0",
    "@nativescript-community/ui-material-bottomsheet": "^7.0.4",
    "@nativescript/background-http": "^6.0.0",
    "@nativescript/camera": "^5.0.12",
    "@nativescript/core": "~8.2.0",
    "@nativescript/imagepicker": "^1.0.6",
    "@nativescript/secure-storage": "^3.0.0",
    "@nativescript/theme": "~3.0.2",
    "@nstudio/nativescript-barcodescanner": "^5.0.1",
    "@nstudio/nativescript-checkbox": "^2.0.5",
    "axios": "^0.27.2",
    "date-fns": "^2.28.0",
    "nativescript-drop-down": "^6.0.2",
    "nativescript-feedback": "^2.0.0",
    "nativescript-iqkeyboardmanager": "^1.5.1",
    "nativescript-ui-sidedrawer": "^10.0.2",
    "nativescript-vue": "~2.9.0",
    "vuex": "^3.6.2"
    },
    "devDependencies": {
    "@nativescript/android": "8.2.2",
    "@nativescript/ios": "8.2.3",
    "@nativescript/webpack": "~5.0.6",
    "nativescript-vue-template-compiler": "~2.9.0"
    }

Please, tell us how to recreate the issue in as much detail as possible.

The image picker works, you tap on the button, it asks for permission to access the device's library and then opens the library. but the images in the library are all empty although there are images on the device.

Screen shot:
WhatsApp Image 2022-06-30 at 9 43 20 AM

Is there any code involved?

uploadPicture (inputIndex) {
            const input = this.detail.steps[inputIndex]
            let context = imagepicker.create({
                mode: 'multiple'
            })
            context.authorize()
                .then(function () {
                    return context.present()
                })
                .then((selection) => {
                    selection.forEach(selected => {
                        console.log(selected)
                        ImageSource.fromAsset(selected).then((imageSource) => {
                            console.log('************ Image Source ***************', imageSource)
                            const folder = knownFolders.documents().path
                            const fileName = this.makeId() + '.jpeg'
                            console.log(fileName)
                            const joinedPath = path.join(folder, fileName)
                            const image = imageSource.resize(1080)
                            const saved = image.saveToFile(joinedPath, 'jpeg')
                            console.log('************ Image saved state ***************', saved)
                            if (saved) {
                                console.log('Image saved successfully!')
                                const file = File.fromPath(joinedPath)
                                input.field.images = input.field.images.filter((image) => !image.brsk_id)
                                input.field.images.push(
                                    {
                                        url: file.path,
                                        thumbnail_url: selected
                                    }
                                )
                                console.log(input.field.images)
                                console.log('************** File *******************', file)
                            } else {
                                console.log('Error saving image')
                            }
                        }).catch((error) => {
                            console.log(error)
                        })
                    })
                }).catch(function (e) {
                console.log('error in selectPicture', e)
            })
        },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant