From 2f8cec4dbb5b23bfeeb9d59ce04ff676517b51da Mon Sep 17 00:00:00 2001 From: smiley Date: Tue, 10 Feb 2026 18:30:55 +0100 Subject: [PATCH] :octocat: clamp the module scale value between 1 and 50 --- src/QROptionsTrait.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/QROptionsTrait.php b/src/QROptionsTrait.php index 6b7c2a73f..cf29cc539 100644 --- a/src/QROptionsTrait.php +++ b/src/QROptionsTrait.php @@ -547,6 +547,13 @@ trait QROptionsTrait{ $this->eccLevel = $eccLevel; } + /** + * clamps the module scale at a minimum of 1 and a maximum of 50 + */ + protected function set_scale(int $scale):void{ + $this->scale = max(1, min($scale, 50)); + } + /** * sets/clamps the quiet zone size */