Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

201
Views
Uncaught ReferenceError: GIF is not defined with gif.js

(Hey I am trying to use the gif.js together with p5.js in the Processing Launcher.

I have trouble getting gif.js to work in the first place because I get the Uncaught ReferenceError: GIF is not defined so I am wondering if I have added the Library correctly. I downloaded them from Github and used them like this:

<!-- PLEASE NO CHANGES BELOW THIS LINE (UNTIL I SAY SO) -->
  <script language="javascript" type="text/javascript" src="libraries/p5.min.js"></script>
  <script language="javascript" type="text/javascript" src="createGif.js"></script>
  <script language="javascript" type="text/javascript" src="myShader.js"></script>
  <script language="javascript" type="text/javascript" src="Larrytarium.js"></script>
  <!-- OK, YOU CAN MAKE CHANGES BELOW THIS LINE AGAIN -->
  <script language="javascript" type="text/javascript" src="libraries/gif.js"></script>
  <script language="javascript" type="text/javascript" src="libraries/gif.worker.js"></script>
  <script language="javascript" type="text/javascript" src="libraries/ready.js"></script>
  <script language="javascript" type="text/javascript" src="libraries/mootools.js"></script>

I am sorry but as being kinda new to all of this, I cannot really work with the minimal Information given on the official GitHub.

This is my current code (createGif.js) where the Error persists, whatever I do:

var CanvasElement = this.p5Canvas

var gif = new GIF({
  workers: 2,
  quality: 10
});

// add a canvas element
gif.addFrame(CanvasElement, {delay: 200});

gif.on('finished', function(blob) {
  window.open(URL.createObjectURL(blob));
});

gif.render();

Maybe it is just something so stupid I cannot see it after looking at it for hours :D Thanks in advance!

EDIT: To further explain: I have two main .js files with one being the p5.js File which includes all the animation and Canvas stuff and the other one is the one for gif.js which content is posted above. The HTML is empty otherwise the imports, like Processing generates it.

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

As discussed in the Comments, it seems to be a problem with the tags. Although I did not yet rearrange them, deleting the language tag seemed to work.

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!