Skip to content

Commit

Permalink
fix: using jpg in webcam example
Browse files Browse the repository at this point in the history
  • Loading branch information
evilsocket committed Feb 6, 2025
1 parent 8ffed08 commit 2e302c8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion examples/webcam/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.png
*.png
*.jpg
4 changes: 2 additions & 2 deletions examples/webcam/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# read the current webcam image from disk
script_path = os.path.abspath(__file__)
script_dir = os.path.dirname(script_path)
screenshot_path = os.path.join(script_dir, "webcam.png")
screenshot_path = os.path.join(script_dir, "webcam.jpg")
image = cv2.imread(screenshot_path)

# add text with wrapping
Expand Down Expand Up @@ -40,7 +40,7 @@
)

# save the image to another file to preserve it
output_path = os.path.join(script_dir, f"{time.time()}.png")
output_path = os.path.join(script_dir, f"{time.time()}.jpg")
cv2.imwrite(output_path, image)

# show the image on a UI
Expand Down
2 changes: 1 addition & 1 deletion examples/webcam/webcam.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def fetch_webcam_image(webcam_url):
# save the image to a file in the same directory as the script
script_path = os.path.abspath(__file__)
script_dir = os.path.dirname(script_path)
screenshot_path = os.path.join(script_dir, "webcam.png")
screenshot_path = os.path.join(script_dir, "webcam.jpg")

cv2.imwrite(screenshot_path, image)

Expand Down

0 comments on commit 2e302c8

Please sign in to comment.