From d5199253818eba7cf72b221e93f60fd78f56e0ad Mon Sep 17 00:00:00 2001 From: Artur Bondarenko Date: Tue, 8 Aug 2023 22:55:44 -0400 Subject: [PATCH 1/2] Improved timings for gifs --- test.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test.py b/test.py index 50fe638..709dd63 100644 --- a/test.py +++ b/test.py @@ -125,6 +125,7 @@ def handle_gif(imageObject, duration=5): while timetot < duration: # Display individual frames from the loaded animated GIF file for frame in range(0,imageObject.n_frames): + start_time = datetime.datetime.now() imageObject.seek(frame) sleep = imageObject.info['duration']/1000 sleep = sleep if sleep > 0 else 0.16 @@ -132,9 +133,12 @@ def handle_gif(imageObject, duration=5): new_im.paste(imageObject) hl = tile_img(new_im, 18, crop=False) # False = scale. send_images(hl) - - timetot+= sleep - time.sleep(sleep) + timetot += sleep + end_time = datetime.datetime.now() + diff = end_time - start_time + actual_sleep = sleep - diff.total_seconds() + if actual_sleep > 0: + time.sleep(actual_sleep) From b75ba39b0eff7c2fa5e6ea3a2a9b20a2472b233f Mon Sep 17 00:00:00 2001 From: Artur Bondarenko Date: Tue, 8 Aug 2023 22:56:05 -0400 Subject: [PATCH 2/2] Updated netInt --- test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.py b/test.py index 709dd63..da1b3ff 100644 --- a/test.py +++ b/test.py @@ -22,7 +22,7 @@ for x in inventory["inventory"]: sn_to_ip[ x["serial_number"] ] = x["ipv6_link_local"] -netInt="en10" +netInt="enp1s0" # Tile images returns a 2d array of an input image split into tiles of given size.