Background image doesn't show on st canvas

Hello,

I am having trouble showing the background image on a canvas.
Here is my code:

canvas_result = st_canvas(
stroke_width=3,
background_image=Image.open(file + “.JPG”),
height=150,
drawing_mode=‘rect’,
point_display_radius=2,
key=“canvas”,
update_streamlit=True
)

Thanks for helping me debug :slight_smile:

Hi @fjosh,

Can you share where you’re getting stuck? Are you seeing an error?

Hello @Caroline ,

Thank’s for the reply :slight_smile:
Actually, I am not getting a message error. It’s just that the canvas is shown without the background image that I defined.
Here is a capture of the thanvas I am getting and a picture of my code:

image

@fjosh Are you seeing any error messages?

@Caroline non no error messages, juste an empty canvas.

Have you double-checked that the image file is named “SAM_5655.JPG” (and not “SAM_5655.jpg”) and is in the same folder as the app?

Hello @Caroline yes the image file is named “SAM_5655.JPG” and is in the same folder as the app script:
image