Merhaba. Yazdırmış olduğum kodu PyInstaller ile .exe dosyasına dönüştürdüm aslında ama dosyada fazla kod yazılmamasına rağmen 29.1 MB ve biraz yavaş açılıyor. Bunu normal görmüyorum aslında. Bu sorunu nasıl çözebilirim?

from PIL import Image
from tkinter import Tk, filedialog, Button, Label
def merge_images_to_pdf(image_list, output_pdf_path):
    # Open images and convert them to RGB mode (required for PDF)
    images = [Image.open(img).convert('RGB') for img in image_list]
    # Save the first image and append the rest to it
    images[0].save(output_pdf_path, save_all=True, append_images=images[1:])
def choose_files():
    # Open file dialog to select multiple image files
    image_files = filedialog.askopenfilenames(
        title="Select JPG files to merge",
        filetypes=[("JPEG files", "*.jpg *.jpeg"), ("All files", "*.*")]
    )
    if image_files:
        # Define the output file path
        output_pdf = filedialog.asksaveasfilename(
            defaultextension=".pdf",
            filetypes=[("PDF files", "*.pdf"), ("All files", "*.*")],
            title="Save Merged PDF as"
        )
        if output_pdf:
            # Merge selected images into a single PDF
            merge_images_to_pdf(image_files, output_pdf)
            result_label.config(text=f"Merged PDF saved as {output_pdf}")
        else:
            result_label.config(text="No output file specified. PDF not saved.")
    else:
        result_label.config(text="No images selected.")
if __name__ == "__main__":
    # Initialize the root Tkinter window
    root = Tk()
    root.title("Image to PDF Merger")
    # Create a "Choose Files" button and attach the choose_files function
    choose_button = Button(root, text="Choose Files", command=choose_files)
    choose_button.pack(pady=20)
    # Create a label to display results
    result_label = Label(root, text="")
    result_label.pack(pady=20)
    # Run the Tkinter event loop
    root.mainloop()