From: Calin Crisan Date: Tue, 24 Jan 2017 15:40:01 +0000 (+0200) Subject: fixed editable mask shifting on some unusual resolutions X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=639cb3fafd65d5e44ffa9ab7eea6405be2e61f00;p=motioneye-debian fixed editable mask shifting on some unusual resolutions --- diff --git a/motioneye/utils.py b/motioneye/utils.py index 4d52ff3..34e5bd7 100644 --- a/motioneye/utils.py +++ b/motioneye/utils.py @@ -829,11 +829,11 @@ def build_editable_mask_file(camera_id, mask_lines, capture_width=None, capture_ # scale the mask vertically in case the aspect ratio has changed # since the last time the mask has been generated - if mask_height == len(mask_lines): + if ny == len(mask_lines): line_index_func = lambda y: y else: - line_index_func = lambda y: (len(mask_lines) - 1) * y / (mask_height - 1) + line_index_func = lambda y: (len(mask_lines) - 1) * y / (ny - 1) rh = height / ny # rectangle height diff --git a/motioneye/wsswitch.py b/motioneye/wsswitch.py index 74895bd..3c34afb 100644 --- a/motioneye/wsswitch.py +++ b/motioneye/wsswitch.py @@ -81,7 +81,8 @@ def _check_ws(): def on_motion_detection_status(camera_id, must_be_enabled, working_schedule_type, enabled=None, error=None): if error: # could not detect current status - return logging.warn('skipping motion detection status update for camera with id %(id)s' % {'id': camera_id}) + return logging.warn('skipping motion detection status update for camera with id %(id)s: %(error)s' % { + 'id': camera_id, 'error': error}) if enabled and not must_be_enabled: logging.debug('must disable motion detection for camera with id %(id)s (%(what)s working schedule)' % {