Skip to content

Commit

Permalink
Camera: reject dimensions larger than default (for now...)
Browse files Browse the repository at this point in the history
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
  • Loading branch information
rwaldron committed Mar 17, 2016
1 parent acff491 commit bf8ba5b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ function Camera(options) {

options = Object.assign({}, cameraDefaults, options || {});

if (options.width > cameraDefaults.width ||
options.height > cameraDefaults.height) {
console.log(`Those dimensions are too big, so I'm ignore them.`);

options.width = cameraDefaults.width;
options.height = cameraDefaults.height;
}

var state = {
isStreaming: false,
stream: options.stream,
Expand Down

0 comments on commit bf8ba5b

Please sign in to comment.