From 124fc0ccfe6c61497865ef285f03299b17fdca2f Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Thu, 24 Feb 2022 21:44:21 +1100 Subject: [PATCH] Update img2logo.py --- Bootup Logos/img2logo.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Bootup Logos/img2logo.py b/Bootup Logos/img2logo.py index 4361872..e16f20b 100755 --- a/Bootup Logos/img2logo.py +++ b/Bootup Logos/img2logo.py @@ -138,18 +138,18 @@ def animated_image_to_bytes(imageIn: Image, negative: bool, dither: bool, thresh frameData.append(frameb) # Store inter-frame duration frameDuration_ms = image.info["duration"] - if frameDuration_ms > 255: - frameDuration_ms = 255 if frameTiming is None or frameTiming < 5: frameTiming = frameDuration_ms print(f"Found {len(frameData)} frames, interval {frameTiming}ms") - if frameTiming < 5 or (frameTiming / 5) > 254: - newTiming = max(frameTiming / 5, 1) + frameTiming = frameTiming / 5 + if frameTiming <= 0 or frameTiming > 254: + newTiming = max(frameTiming, 1) newTiming = min(newTiming, 254) print(f"Inter frame delay {frameTiming} is out of range, and is being adjusted to {newTiming*5}") frameTiming = newTiming - # We have no mangled the image into our frambuffers + + # We have now mangled the image into our framebuffers # Now we can build our output data blob # First we always start with a full first frame; future optimisation to check if we should or not