processing/p5.js

GIFs that don't loop break unless reset before play()

Open

#5,228 opened on May 6, 2021

View on GitHub
 (11 comments) (0 reactions) (1 assignee)JavaScript (3,178 forks)batch import
Area:ImageBugHelp Wantedp5.js 2.0+

Repository metrics

Stars
 (20,784 stars)
PR merge metrics
 (Avg merge 8d 13h) (45 merged PRs in 30d)

Description

Most appropriate sub-area of p5.js?

  • Accessibility (Web Accessibility)
  • Build tools and processes
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Friendly error system
  • Image
  • IO (Input/Output)
  • Localization
  • Math
  • Unit Testing
  • Typography
  • Utilities
  • WebGL
  • Other (specify if possible)

Details about the bug:

  • p5.js version: 1.0+
  • Web browser and version: all
  • Operating System: all
  • Steps to reproduce this: Here is an example. Comment out the gif.setFrame(0) to see the crash and unfriendly error log.

I think it is okay to expect the coder to manually reset to the beginning of a non-looping GIF before playing but when they don't do that it shouldn't crash. A check to make sure that gifProperties.displayIndex never exceeds gifProperties.frames.length - 1 should do the trick!

This could be a nice issue for a newer contributor. I am happy to help.

Contributor guide