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

Have an event for gr.ImageEditor that fires when the base image changes (e.g. when an example value is selected) #8071

Open
1 task done
canytam-krystal opened this issue Apr 19, 2024 · 3 comments
Labels

Comments

@canytam-krystal
Copy link

  • I have searched to see if a similar issue already exists.

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
When I clicked the example of an app which change the image of an image editor, I expect the image editor will generate a upload event so I can clear the previous output. But no event is generated so the output is kept.

Describe the solution you'd like
A clear and concise description of what you want to happen.
Just activate an upload event for the image editor so I can do related task.

Additional context
Add any other context or screenshots about the feature request here.

@abidlabs
Copy link
Member

@canytam-krystal can you use the .change() event for this?

@canytam-krystal
Copy link
Author

The change() event should be used for editing the layer.
For example, if load a new example, it should clear the output but after I change the layer, it should generate a new output. So I think upload event should be triggered when example is loaded.

@abidlabs
Copy link
Member

Hi @canytam-krystal the upload event for ImageEditor and for similar components like Image or Audio is only triggered when a user specifically uploads a file, not when the base value changes. However, I do understand that you're looking for an event specifically when the background image changes, so I'll rename this issue to that effect

@abidlabs abidlabs changed the title When an example is selected, there should be a upload event generated on the Image editor. Have an event for gr.ImageEditor that fires when the base image changes (e.g. when an example value is selected) Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants