-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Ubuntu2204 webcam mode bugfix #878
base: premain
Are you sure you want to change the base?
Ubuntu2204 webcam mode bugfix #878
Conversation
Reviewer's Guide by SourceryThis pull request fixes a bug in webcam mode on Ubuntu 22.04 where the preview window sometimes has an incorrect initial size, causing a crash. The fix sets a default preview window size to avoid the issue. Sequence diagram for webcam preview window initializationsequenceDiagram
participant User
participant App
participant PreviewWindow
participant CV2
User->>App: Start webcam mode
App->>PreviewWindow: Create preview window
Note over PreviewWindow: Set default size 800x600
PreviewWindow->>CV2: Resize image to window size
CV2-->>PreviewWindow: Return resized image
PreviewWindow-->>User: Display preview
State diagram for preview window size handlingstateDiagram-v2
[*] --> WindowCreation
WindowCreation --> DefaultSize: Set 800x600
DefaultSize --> Resizable: Enable user resizing
Resizable --> UserResized: User changes size
UserResized --> Resizable: New size applied
Resizable --> [*]: Window closed
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @renmengqisheng - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
- The change in donation URL from PayPal to an unfamiliar domain raises security concerns. (link)
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🔴 Security: 1 blocking issue
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
modules/ui.py
Outdated
@@ -371,7 +371,7 @@ def create_root(start: Callable[[], None], destroy: Callable[[], None]) -> ctk.C | |||
text_color=ctk.ThemeManager.theme.get("URL").get("text_color") | |||
) | |||
donate_label.bind( | |||
"<Button>", lambda event: webbrowser.open("https://paypal.me/hacksider") | |||
"<Button>", lambda event: webbrowser.open("https://deeplivecam.net") |
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.
🚨 issue (security): The change in donation URL from PayPal to an unfamiliar domain raises security concerns.
Please verify if this is an intentional change and ensure the new domain is legitimate and secure for users.
…eview function Signed-off-by: litao <[email protected]>
ce3efed
to
c25d4bc
Compare
In my environment (OS: Ubuntu22.04, Python: 3.10.16, CUDA: 11.8, GPU: RTX 4070 laptop), the value of
PREVIEW.winfo_width()
is 1, which causes thefit_image_to_size
function to have a value of 0 when calculatingnew_size
andcv2.resize(image, dsize=new_size)
crashes, as shown in the following figure.The initial size of the preview window will be determined by the operating system and window manager, and may be a smaller window by default (such as 1 or other temporary values) or automatically adjusted based on the size of the parent window.
After setting the default window size, it can work normally.
Summary by Sourcery
Fix a crash in webcam mode on Ubuntu 22.04 when the preview window is initialized with a width of 1.
Bug Fixes:
Enhancements: