processing/p5.js

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

Open

#5228 aperta il 6 mag 2021

Vedi su GitHub
 (11 commenti) (0 reazioni) (1 assegnatario)JavaScript (3178 fork)batch import
Area:ImageBugHelp Wantedp5.js 2.0+

Metriche repository

Star
 (20.784 star)
Metriche merge PR
 (Merge medio 8g 13h) (45 PR mergiate in 30 g)

Descrizione

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.

Guida contributor