1

I have a response from a server that gives me an xbase64 image. I need to turn this image into a FitImage. My kivy file has an element like this:

FitImage:
        id: fish_image
        pos_hint: {'center_y': 0.85}
        allow_stretch: True
        size_hint_y: None
        width: 200
        height: 270

Here is the code I use but it doesn't work, please help if you can)

image_bytes = base64.b64decode(fish_data['fields']['fish_image'])
buf = io.BytesIO(image_bytes)
cim = CoreImage(buf, ext = 'png')
self.fish_image.texture = cim.texture

here fish_data['fields']['fish_image'] contains xbase64 image

0 Answers0