diff --git a/src/cli/test.py b/src/cli/test.py index 21cb2db..dbcd06d 100644 --- a/src/cli/test.py +++ b/src/cli/test.py @@ -183,7 +183,7 @@ try: # Delay the frame if slowmode is on if slow_mode: - time.sleep(.5 - frame_time) + time.sleep(max([.5 - frame_time, 0.0])) if exposure != -1: # For a strange reason on some cameras (e.g. Lenoxo X1E) diff --git a/src/compare.py b/src/compare.py index 658f94f..5966b8d 100644 --- a/src/compare.py +++ b/src/compare.py @@ -291,5 +291,5 @@ while True: # are captured and even after a delay it does not # always work. Setting exposure at every frame is # reliable though. - video_capture.intenal.set(cv2.CAP_PROP_AUTO_EXPOSURE, 1.0) # 1 = Manual - video_capture.intenal.set(cv2.CAP_PROP_EXPOSURE, float(exposure)) + video_capture.internal.set(cv2.CAP_PROP_AUTO_EXPOSURE, 1.0) # 1 = Manual + video_capture.internal.set(cv2.CAP_PROP_EXPOSURE, float(exposure)) diff --git a/src/pam.py b/src/pam.py index f3ef340..08cccef 100644 --- a/src/pam.py +++ b/src/pam.py @@ -48,26 +48,26 @@ def doAuth(pamh): if not config.getboolean("core", "suppress_unknown"): pamh.conversation(pamh.Message(pamh.PAM_ERROR_MSG, "No face model known")) - syslog.syslog(syslog.LOG_ERR, "Failure, no face model known") + syslog.syslog(syslog.LOG_NOTICE, "Failure, no face model known") syslog.closelog() return pamh.PAM_USER_UNKNOWN # Status 11 means we exceded the maximum retry count elif status == 11: pamh.conversation(pamh.Message(pamh.PAM_ERROR_MSG, "Face detection timeout reached")) - syslog.syslog(syslog.LOG_WARNING, "Failure, timeout reached") + syslog.syslog(syslog.LOG_INFO, "Failure, timeout reached") syslog.closelog() return pamh.PAM_AUTH_ERR # Status 12 means we aborted elif status == 12: - syslog.syslog(syslog.LOG_ERR, "Failure, general abort") + syslog.syslog(syslog.LOG_INFO, "Failure, general abort") syslog.closelog() return pamh.PAM_AUTH_ERR # Status 13 means the image was too dark elif status == 13: - syslog.syslog(syslog.LOG_WARNING, "Failure, image too dark") + syslog.syslog(syslog.LOG_INFO, "Failure, image too dark") syslog.closelog() pamh.conversation(pamh.Message(pamh.PAM_ERROR_MSG, "Face detection image too dark")) return pamh.PAM_AUTH_ERR @@ -83,7 +83,7 @@ def doAuth(pamh): # Otherwise, we can't discribe what happend but it wasn't successful pamh.conversation(pamh.Message(pamh.PAM_ERROR_MSG, "Unknown error: " + str(status))) - syslog.syslog(syslog.LOG_ERR, "Failure, unknown error" + str(status)) + syslog.syslog(syslog.LOG_INFO, "Failure, unknown error" + str(status)) syslog.closelog() return pamh.PAM_SYSTEM_ERR