refactored shitty unusable code
Signed-off-by: rattatwinko <seppmutterman@gmail.com>
This commit is contained in:
@@ -34,7 +34,18 @@ public class WebcamCaptureLoop {
|
||||
|
||||
Thread captureThread = new Thread(() -> {
|
||||
// this is where we open it. if the res isnt known then it fucks up.
|
||||
webcam.open();
|
||||
try {
|
||||
webcam.open();
|
||||
} catch (WebcamException e) {
|
||||
JOptionPane.showMessageDialog(
|
||||
null,
|
||||
"WebcamException" + e.getMessage(),
|
||||
"WebcamException",
|
||||
JOptionPane.ERROR_MESSAGE
|
||||
);
|
||||
} finally {
|
||||
webcam.open();
|
||||
}
|
||||
|
||||
while (running) {
|
||||
BufferedImage img = webcam.getImage();
|
||||
|
||||
Reference in New Issue
Block a user