diff --git a/src/components/brother_label_printer.py b/src/components/brother_label_printer.py index 49db337..a1a1385 100644 --- a/src/components/brother_label_printer.py +++ b/src/components/brother_label_printer.py @@ -26,7 +26,7 @@ class BrotherLabelPrinter(Component): try: barcode_img = qr.make_image(fill_color="black", back_color="white") - barcode_img = barcode_img.resize((250, 380)) + barcode_img = barcode_img.resize((250, 250)) print_width = 720 print_height = 380 label_img = Image.new("RGB", (print_width, print_height), color=(255, 255, 255)) @@ -37,22 +37,17 @@ class BrotherLabelPrinter(Component): draw.text((280, 50), "ETICHETTA \nINTEROPERAZIONALE", (0, 0, 0), font=font) draw.text((280, 150), barcode, (0, 0, 0), font=font2) - # Rotazione dell'immagine di 90 gradi in senso antiorario - rotated_label_img = label_img.rotate(90, expand=True) - - # Salvataggio dell'immagine if not os.path.exists("./tmp/"): os.makedirs("./tmp/") - rotated_label_img.save(file_name) + label_img.save(file_name) - # Stampa dell'immagine hdc = win32ui.CreateDC() hdc.CreatePrinterDC(printer_name) hdc.StartDoc(file_name) hdc.StartPage() - dib = ImageWin.Dib(rotated_label_img) + dib = ImageWin.Dib(label_img.rotate(90, expand=True)) # Ruota di 270 gradi per stampare correttamente dib.draw(hdc.GetHandleOutput(), (0, 0, print_height, print_width)) # Inverto larghezza e altezza hdc.EndPage() diff --git a/src/ui/test_instructions/test_instructions.py b/src/ui/test_instructions/test_instructions.py index 82c107e..ae87a6f 100644 --- a/src/ui/test_instructions/test_instructions.py +++ b/src/ui/test_instructions/test_instructions.py @@ -62,12 +62,7 @@ class Test_Instructions(Test_Test): return show def toggle_icons(self): - default_image_path = os.path.join("config", "instruction_images", self.config["machine"]["instruction_folder"], - "DEFAULT.svg") - if self.svg_path is None or self.svg_path == default_image_path: - if hasattr(self, - "print_b") and not self.done: # Verifica se il pulsante di stampa è abilitato e non è stato premuto self.flag = not self.flag for elem in self.tape_ids: