From 351ba0a77a5187f66102fcfb2b2c3991de30c5e5 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sat, 22 Jun 2024 13:44:33 +0200 Subject: Fix width calculation --- barcode_gen.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/barcode_gen.py b/barcode_gen.py index dc000bf..c8d16bb 100644 --- a/barcode_gen.py +++ b/barcode_gen.py @@ -91,8 +91,7 @@ def cli(data, outfile, height, text, font, font_size, bar_width, margin, color, ]) data_encoded = [True, False, True, False, *data_encoded, False, True, True, False, True] - bars = 32/2*3 + 2 - width = bars * bar_width + width = len(data_encoded) * bar_width # 1 px = 0.75 pt pt_to_mm = lambda pt: pt / 0.75 /dpi * 25.4 font_size = pt_to_mm(font_size) -- cgit