diff --git a/ezgg_logo.png b/ezgg_logo.png new file mode 100644 index 0000000..3ccd890 Binary files /dev/null and b/ezgg_logo.png differ diff --git a/joystix.otf b/joystix.otf new file mode 100644 index 0000000..20a3100 Binary files /dev/null and b/joystix.otf differ diff --git a/main.py b/main.py new file mode 100644 index 0000000..c9d06ba --- /dev/null +++ b/main.py @@ -0,0 +1,42 @@ +from pathlib import Path + +import qrcode +from PIL import Image, ImageDraw, ImageFont + +COLOR = (1, 135, 134) +FONT_LINK = ImageFont.truetype("joystix.otf", size=22) +FONT_ID = ImageFont.truetype("joystix.otf", size=28) +FONT_TEXT = ImageFont.truetype("joystix.otf", size=40) +ID_PREFIX = "EZ-ID:" +OUT_DIR = Path("./output") + +num_label_start = int(input("Start ID: ")) +num_label_end = int(input("End ID: ")) + +for num in range(num_label_start, num_label_end + 1): + num_as_string = f"{num:06}" + label_id = f"{ID_PREFIX}{num_as_string}" + print(f"Generating label \"{label_id}\"") + + label = Image.new("RGB", (800, 350), (255, 255, 255)) + logo = Image.open("ezgg_logo.png") + + qr = qrcode.QRCode( + version=1, + error_correction=qrcode.constants.ERROR_CORRECT_L + ) + + qr.add_data(label_id) + qr.make(fit=True) + qr_img = qr.make_image(fill_color=COLOR, back_color="white") + + label.paste(qr_img, (0, 10)) + label.paste(logo, (290, 120)) + + draw = ImageDraw.Draw(label) + + draw.text((15, 285), label_id, font=FONT_ID, fill=COLOR) + draw.text((320, 38), "Eigentum der", font=FONT_TEXT, fill=COLOR) + draw.text((570, 300), "ezgg-ev.de", font=FONT_LINK, fill=COLOR) + + label.save(OUT_DIR / f"{num_as_string}.png") diff --git a/output/.gitkeep b/output/.gitkeep new file mode 100644 index 0000000..e69de29