-
Notifications
You must be signed in to change notification settings - Fork 3k
Refactor and redesign ImageEditor
component
#10635
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
Conversation
Anyway you can do two things:
You cannot do both. My main question is the interplay between crop and resize. Should crop refocus on the resized image? It probably should since it is an image crop.
|
The python API won't do anything and I don't expect it to work with gradio right now, just dealing with finalising the UI work. |
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-pypi-previews.s3.amazonaws.com/32d560f2533cf7136be71e0af2f5891e276862e6/gradio-5.23.3-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@32d560f2533cf7136be71e0af2f5891e276862e6#subdirectory=client/python" Install Gradio JS Client from this PR npm install https://gradio-npm-previews.s3.amazonaws.com/32d560f2533cf7136be71e0af2f5891e276862e6/gradio-client-1.14.1.tgz Use Lite from this PR <script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/32d560f2533cf7136be71e0af2f5891e276862e6/dist/lite.js""></script> |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
@pngwn I wasn't able to do a lot of testing since the image upload and drawing features are the broken state, even separately for me: ![]()
I agree, and just to confirm, cropping can be undo-ed?
I'm not sure which menu UIs we are referring to? Can you elaborate or share a screenshot? |
Ah, that is slightly more broken than intended but I see the issue locally too. I'll repost with more clarity shortly. |
@hannahblair I will consider your request. Jk, yeah I'll change that! |
Very very cool @pngwn! Just going through and testing, I noticed a few things:
Screen.Recording.2025-03-07.at.1.56.11.PM.mov
![]()
![]() The alt text says maximize but it seems to have no effect. If it's really maximizing the input image, then I suggest moving it to the zoom toolbar.
![]()
Actually interestingly, after you upload an image right now, the tool doesn't change, but you have the ability to draw on the uploaded image. However, this drawing is very jerky and buggy. Only when you actually click on the draw tool can you draw reliably, see this: Screen.Recording.2025-03-07.at.2.18.24.PM.mov(still testing...) |
Love the erasing UX! Screen.Recording.2025-03-07.at.2.28.23.PM.mov |
(5) The cropping and resizing don't apply to the annotations. Is that expected? I would have expected everything to be cropped/resized: Screen.Recording.2025-03-07.at.2.39.44.PM.mov(you'll also notice a flaky behavior the first time the cropping tool was used). The code here is just: import gradio as gr
with gr.Blocks() as demo:
with gr.Row():
ie = gr.ImageEditor()
io = gr.Image()
b = gr.Button()
b.click(lambda x: x["composite"], ie, io)
demo.launch() |
The zooming works great, exactly as expected |
Heroic work @pngwn ! Works great. Noticed some small issues. Apologies if they are repeats/made obsolete by @hannahblair 's upcoming UI enhancements
![]()
![]()
![]()
|
### Description This pull request updates the `get_node_path` function in the `gradio/utils.py` file to handle scenarios where the `which` command is missing. The function has been improved by splitting the error handling into two separate `try` blocks for better granularity and robustness. ### Changes Made - Split the `try` block into two separate `try` blocks for handling Windows and Unix-like systems. - Added error handling for `FileNotFoundError` in addition to `subprocess.CalledProcessError`. ### Rationale The original implementation did not properly handle the case when the `which` command is missing. This update ensures the function gracefully handles such scenarios and continues to check other possible locations for the `node` executable.
* fix: latex rendering of markdown * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Dawood Khan <dawoodkhan82@gmail.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
js/upload/src/Upload.svelte
Outdated
@@ -58,7 +62,7 @@ | |||
} | |||
return "." + type; | |||
}; | |||
|
|||
console.log({ filetype }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stray consoles like this
@pngwn I pushed some changes to fix the Python formatting and tests. I spent quite a bit of time trying to understand why the video e2e test is failing. Unfortunately I couldn't quite figure it out. It seems like the test chromium browser that is used by playwright doesn't handle video uploads properly. You can check this by running the
to manually upload a video. In my experience, the video doesn't get uploaded correctly so we don't get the play/pause video controls for playwright to "click on" and trigger the play/pause events. I can't figure out what's different about this browser that prevents the videos from being uploaded and the part I really don't understand is why this test passes on If you can't figure it out by tomorrow, I think it's okay to remove these tests since I've tested the |
Okay @abidlabs I have fixed both the obscured text and the issues wth certain image not showing crop handles (many images did it, initialisation issue). When CI passes, I shall murj. |
…gradio into image-editor-rewrite
Only took 5 hours. |
Fixes:
gr.Image
andgr.ImageEditor
support image scaling (zoom in and out)? #6667Misc Fixes/ work: