Skip to content

Commit

Permalink
Decrease image counter if an image could not be captured from webcam
Browse files Browse the repository at this point in the history
Should keep rendering of timelapse from breaking if only a couple of images couldn't be captured due to whatever reason. Suggested by @midopple in #344
  • Loading branch information
foosel committed Apr 1, 2014
1 parent 7b56b36 commit bf9d5ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/octoprint/timelapse.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ def _captureWorker(self, filename):
urllib.urlretrieve(self._snapshotUrl, filename)
self._logger.debug("Image %s captured from %s" % (filename, self._snapshotUrl))
except:
self._logger.exception("Could not capture image %s from %s" % (filename, self._snapshotUrl))
self._logger.exception("Could not capture image %s from %s, decreasing image counter again" % (filename, self._snapshotUrl))
self._imageNumber -= 1
eventManager().fire(Events.CAPTURE_DONE, {"file": filename})

def _createMovie(self, success=True):
Expand Down

0 comments on commit bf9d5ef

Please sign in to comment.