diff --git a/main.py b/main.py index fd62b68..a04bb5b 100644 --- a/main.py +++ b/main.py @@ -41,8 +41,8 @@ images = [] # Fonction pour charger une image en utilisant un thread -def load_image(image_path): - with Image.open(image_path) as img: +def load_image(local_image_path): + with Image.open(local_image_path) as img: img.thumbnail(screen.get_size()) images.append(pygame.image.fromstring(img.tobytes(), img.size, "RGB")) @@ -62,9 +62,10 @@ for image_thread in image_threads: class ImageHandler(FileSystemEventHandler): - def on_modified(self, event): - if event.src_path.endswith('.jpg') or event.src_path.endswith('.png'): - load_image(event.src_path) + def on_modified(self, local_event): + if local_event.src_path.endswith('.jpg') or local_event.src_path.endswith('.png'): + load_image(local_event.src_path) + def watch_images_directory(): event_handler = ImageHandler() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..2cf80a0 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +pygame~=2.3.0 +Pillow~=9.5.0 +watchdog~=3.0.0 \ No newline at end of file