Skip to content

Commit

Permalink
Put camera res into property
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Apr 20, 2015
1 parent 9b9d9c0 commit 67adbd8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/roam/editorwidgets/imagewidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,16 @@ def takeimage(self, *args):
self.imagecaptured.emit(self.pixmap)
self.done.emit()

@property
def camera_res(self):
width, height = tuple(roam.config.settings['camera_res'].split(','))
return width, height

def start(self, dev=1):
try:
self.cam = vc.Device(dev)
try:
width, height = tuple(roam.config.settings['camera_res'].split(','))
width, height = self.camera_res
self.cam.setResolution(int(width), int(height))
except KeyError:
pass
Expand Down

0 comments on commit 67adbd8

Please sign in to comment.