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

TypeError: Cannot read properties of undefined (reading 'read') #7

Open
chongzicbo opened this issue May 16, 2024 · 3 comments
Open

Comments

@chongzicbo
Copy link

Hi, thanks for your great work. When I click the button "Paste an image", the following bug always occurs. Do you know why? Thank you.
image

@KarstenVogt
Copy link

Hi,
I'm experiencing the same error message. I hope someone can help here.

@zixuzhuang
Copy link

same error message, with win10+Chrome+streamlit[Version 1.36.0]

@KarstenVogt
Copy link

KarstenVogt commented Jun 25, 2024

Hi Zixu,

I hope this helps:

i took https://github.com/streamlit/streamlit-example

Then added:

`from streamlit_paste_button import paste_image_button as pbutton
...
paste_result = pbutton("paste image", text_color="#1c2c5e", background_color="#fafcfd", hover_background_color="#deefff", errors="raise")

            if paste_result.image_data is not None:
                image_data = paste_result.image_data.tobytes()
                image_hash = hashlib.md5(image_data).hexdigest()`

This only works in https sessions due to browser security reasons.

Firefox users may need to modify the asyncClipboard in the about:config. Please take this with a grain of salt.

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

3 participants