Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • B bjgf
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 127
    • Issues 127
    • List
    • Boards
    • Service Desk
    • Milestones
  • Jira
    • Jira
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • BlueJ
  • bjgf
  • Issues
  • #2164
Closed
Open
Issue created Nov 20, 2019 by Neil Brown@nccbMaintainer

[GREENFOOT-837] Add image sharing to GifImage helper class

The GifImage class in Greenfoot does two things: (1) it loads a GIF and splits it into an array of images and (2) it allows the GIF to be run and tells you which image is the valid one at any point in time. The first part is expensive, especially on the gallery where Javascript image creation can be slow. It would be good for GIF files that are used by multiple actors to be able to share that part, but then animate separately. I think the two obvious solutions are either (A) a hidden internal static cache of loaded GIF images or (B) a copy constructor for GifImage that lets it share the loaded images but run at its own rate. A is easier for beginners, but also can cause correctness problems (e.g. if the file is modified between loads) so I think B may be best.


Issue metadata

  • Issue type: Bug
  • Priority: Medium
  • Fix versions: 3.7.0
Assignee
Assign to
Time tracking