diff --git a/webcam-capture-drivers/driver-fswebcam/README.md b/webcam-capture-drivers/driver-fswebcam/README.md index 63167b65..2d3d6275 100644 --- a/webcam-capture-drivers/driver-fswebcam/README.md +++ b/webcam-capture-drivers/driver-fswebcam/README.md @@ -42,6 +42,26 @@ public class TakePictureExample { } ``` +The snapshot version is available in the Sonatype Snapshot Maven repository: + + + Sonatype OSS Snapshot Repository + http://oss.sonatype.org/content/repositories/snapshots + + +Dependency: + + + com.github.sarxos + webcam-capture-driver-fswebcam + 0.3.10-SNAPSHOT + + +It can be also downloaded manually from: + +https://oss.sonatype.org/content/repositories/snapshots/com/github/sarxos/webcam-capture-driver-fswebcam/0.3.10-SNAPSHOT + + ## Issues There are several known issues. If you have an idea of how those can diff --git a/webcam-capture/src/main/java/com/github/sarxos/webcam/ds/buildin/WebcamDefaultDevice.java b/webcam-capture/src/main/java/com/github/sarxos/webcam/ds/buildin/WebcamDefaultDevice.java index 068d29c9..e54a28b2 100644 --- a/webcam-capture/src/main/java/com/github/sarxos/webcam/ds/buildin/WebcamDefaultDevice.java +++ b/webcam-capture/src/main/java/com/github/sarxos/webcam/ds/buildin/WebcamDefaultDevice.java @@ -161,9 +161,15 @@ public Dimension getResolution() { @Override public void setResolution(Dimension size) { + + if (size == null) { + throw new IllegalArgumentException("Size cannot be null"); + } + if (open.get()) { throw new IllegalStateException("Cannot change resolution when webcam is open, please close it first"); } + this.size = size; } @@ -233,6 +239,9 @@ public void open() { if (size == null) { size = getResolutions()[0]; } + if (size == null) { + throw new RuntimeException("The resolution size cannot be null"); + } LOG.debug("Webcam device {} starting session, size {}", device.getIdentifierStr(), size);