Rework the webcam detection

This commit is contained in:
nono
2025-06-24 23:27:28 +02:00
parent 981eba100d
commit 117f069351
3 changed files with 110 additions and 119 deletions

View File

@@ -105,9 +105,9 @@ class Printer(object):
clean_msg = str(msg)
clean_signature = str(signature)
if len(clean_msg) > 256 or len(clean_msg) < 3 :
if len(clean_msg) > 4096 or len(clean_msg) < 3 :
self.app.logger.warning("Could not print message of this length: " + str(len(clean_msg)))
raise Exception("Could not print message of this length :" + str(len(clean_msg)) + ", needs to between 3 and 256 caracters long.")
raise Exception("Could not print message of this length :" + str(len(clean_msg)) + ", needs to between 3 and 4096 caracters long.")
if len(signature) > 256 or len(signature) < 3:
self.app.logger.warning("Could not print signature of this length: " + str(len(clean_signature)))
@@ -176,8 +176,8 @@ class Printer(object):
def process_image(self, path):
brightness_factor = 1.5 # Used only if image is too dark
brightness_threshold = 150 # Brightness threshold (0255)
contrast_factor = 1.2 # Less than 1.0 = lower contrast
brightness_threshold = 100 # Brightness threshold (0255)
contrast_factor = 0.6 # Less than 1.0 = lower contrast
max_width = 575
max_height = 1000