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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix image upload #6363

Merged
merged 3 commits into from Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/olive-baboons-divide.md
@@ -0,0 +1,6 @@
---
"@gradio/image": patch
"gradio": patch
---

feat:Fix image upload
2 changes: 1 addition & 1 deletion js/image/Index.svelte
Expand Up @@ -122,7 +122,7 @@

<ImageUploader
bind:active_tool
bind:value={_value}
bind:value
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was happening is that we were binding to _value so the value prop (which is what gets passed to events) was never updated during the upload.

I think this is the right thing to do. By binding to value, _value will automatically be updated. Also the ImageUploaded calls normalise_file so value will have the right url

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of the test cases from #6322 work with this change as far as I can tell

image image

selectable={_selectable}
{root}
{sources}
Expand Down