We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8af2cf6 + 017fd96 commit 42b8c8aCopy full SHA for 42b8c8a
examples/is31fl3731_pillow_animated_gif.py
@@ -23,7 +23,6 @@
23
#display = adafruit_is31fl3731.Matrix(i2c)
24
# uncomment line if you are using Adafruit 16x9 Charlieplexed PWM LED Matrix
25
display = adafruit_is31fl3731.CharlieBonnet(i2c)
26
-display.fill(0)
27
28
# Open the gif
29
if len(sys.argv) < 2:
@@ -40,11 +39,14 @@
40
39
41
# Get the autoplay information from the gif
42
delay = image.info['duration']
43
-loops = image.info['loop']
44
45
-# Adjust loop count (0 is forever)
46
-if loops > 0:
47
- loops += 1
+# Figure out the correct loop count
+if "loop" in image.info:
+ loops = image.info['loop']
+ if loops > 0:
+ loops += 1
48
+else:
49
+ loops = 1
50
51
# IS31FL3731 only supports 0-7
52
if loops > 7:
0 commit comments