andfanilo / streamlit-drawable-canvas

Do you like Quick, Draw? Well what if you could train/predict doodles drawn inside Streamlit? Also draws lines, circles and boxes over background images for annotation.
https://drawable-canvas.streamlit.app/
MIT License
576 stars 88 forks source link

Fix: correctly handle image URLs #85

Closed andreaferretti closed 2 years ago

andreaferretti commented 2 years ago

This PR fixes an issue where image URLs are not correctly handled when a streamlit app is not exposed on the root of the domain. I think it fixes https://github.com/andfanilo/streamlit-drawable-canvas/issues/83

Basically, we always pass a relative URL on the Python side, then we reconstruct the full URL on the frontend. This works both in development and in deployment, so it removes the need for these lines

andfanilo commented 2 years ago

I'm so sorry, I missed this! Github did not notify me...I'll have a look ASAP, did you test on Streamlit Cloud?

andreaferretti commented 2 years ago

I'm sorry, I only tested locally and on our servers

andfanilo commented 2 years ago

Ok thanks, don't worry I'll do a fake release and test myself, and if it works I'll do a real release Thanks for assisting! This has been in my todo forever...

andfanilo commented 2 years ago

Version 0.9.2 integrates your fix and works on https://drawable-canvas.streamlitapp.com/, thank you very much! If you have a Twitter/Linkedin handle, I'd love to mention you in a post (you don't have to :) )

andreaferretti commented 2 years ago

Sure, here is my LinkedIn profile

https://it.linkedin.com/in/ferrettiandrea