From 8d73824e9a8775ac484d970edaa177b96796e72d Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Fri, 4 Sep 2026 03:14:21 -0500 Subject: [PATCH] Treat a zero GIF delay as 100ms A GIF frame delay under 20ms means "as fast as possible", and browsers clamp it to 100ms - the speed the emote actually plays at where people see it. Summed literally, :Awkward: reported 76 frames lasting 0.1s and collapsed to a single still. Any emote authored that way would have silently become a static image. --- tools/add_emote.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/add_emote.py b/tools/add_emote.py index 39ef65b..e2a166f 100644 --- a/tools/add_emote.py +++ b/tools/add_emote.py @@ -84,6 +84,11 @@ def load_frames(blob): fitted.paste(scaled, ((cw - scaled.width) // 2, (ch - scaled.height) // 2)) frames.append(fitted) durations.append(page.info.get('duration') or 0) + # A GIF delay under 20ms means "as fast as possible"; browsers clamp it to + # 100ms, so that is the speed the emote actually plays at where people see + # it. Taken literally, a sheet of zero-delay frames looks like a 0-second + # animation and collapses to one frame. + durations = [d if d >= 20 else 100 for d in durations] return frames, durations, (cw, ch)