Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using saveGif() in instance mode and WEBGL mode #6724

Closed
2 of 17 tasks
ChimiSeanGa opened this issue Jan 10, 2024 · 2 comments · Fixed by #6726
Closed
2 of 17 tasks

Error when using saveGif() in instance mode and WEBGL mode #6724

ChimiSeanGa opened this issue Jan 10, 2024 · 2 comments · Fixed by #6726

Comments

@ChimiSeanGa
Copy link

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build Process
  • Unit Testing
  • Internalization
  • Friendly Errors
  • Other (specify if possible)

p5.js version

1.9.0

Web browser and version

Safari 17.1

Operating System

macOS Sonoma 14.1.1

Steps to reproduce this

Steps:

  1. Run a sketch in instance mode and in WEBGL mode
  2. Add a saveGif() command anywhere
  3. Upon calling saveGif(), an error will be thrown saying ReferenceError: Can't find variable: height

Snippet:

let sketch = function(p) {
  p.setup = function() {
    p.createCanvas(500, 500, p.WEBGL);
  };

  p.draw = function() {
  };
  
  p.keyPressed = function() {
    if (p.key === 's') {
      p.saveGif('test', 5);
    }
  }
};

let myp5 = new p5(sketch);

You can run this in the web editor as well. If you remove the p.WEBGL parameter, saveGif() works just fine.

Copy link

welcome bot commented Jan 10, 2024

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!

@mohitbalwani
Copy link
Contributor

Thanks for reporting the issue @ChimiSeanGa! I spent some time on this issue and found that we were not passing the width and height to the function. I made those changes and created PR #6726 which should resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants