Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

210
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda