kivy python, plyer filechooser uploaded image is black! | android

80 Views Asked by At

It was necessary to make an application for android in which you can select a photo from the phone’s memory and this photo just needs to be displayed in diligence and I did it but it’s black why I don’t understand please help

enter image description here

I tried to solve it by all methods and I think that the problem is that the photo is loaded and there is no photo color, because the size of the zone where you need to put the photo changes but the picture is not visible just a black canvas

.kv file

<PhotoWindow>:
    name: 'photo'

    Image:
        id: img
        source: '1.jpg'
        texture: self.texture
        #pos: self.pos
        size_hint: 1, None
        size: root.size
        allow_stretch: True
        keep_ratio: True

main.py

    def file_chooser(self):
        filechooser.open_file(on_selection=self.selected)

    def selected(self, selection):
        if selection:
            self.root.get_screen('photo').ids.img.source = selection[0]
0

There are 0 best solutions below