summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--barcode_gen.py3
1 files changed, 1 insertions, 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)