# Getting p5.gif.js working in the p5.js web editor

**URL:** <https://discourse.processing.org/t/getting-p5-gif-js-working-in-the-p5-js-web-editor/7787>\
**Category:** Libraries\
**Created:** [January 24, 2019, 11:23am UTC](https://discourse.processing.org/t/getting-p5-gif-js-working-in-the-p5-js-web-editor/7787 "2019-01-24T11:23:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgl](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jgl/32/3401_2.png) [@jgl](https://discourse.processing.org/u/jgl)\
**Post date:** [January 24, 2019, 11:23am UTC](https://discourse.processing.org/t/getting-p5-gif-js-working-in-the-p5-js-web-editor/7787/1 "2019-01-24T11:23:43Z")

</div>

Hi All,

I’m trying to get the example here:

> **[antiboredom/p5.gif.js](https://github.com/antiboredom/p5.gif.js/tree/master/examples)**
>
> let's you play gifs in p5. Contribute to antiboredom/p5.gif.js development by creating an account on GitHub.

Working in the p5.js web editor. You can see it not running here:

[https://editor.p5js.org/jgl/sketches/xpBHHsWz9](https://editor.p5js.org/jgl/sketches/xpBHHsWz9)

It’s currently erroring with:

“InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable (sketch: line 10)”

I don’t think the gif image is getting loaded properly. Does anyone have any ideas?

Cheers,

Joel

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [January 24, 2019, 12:02pm UTC](https://discourse.processing.org/t/getting-p5-gif-js-working-in-the-p5-js-web-editor/7787/2 "2019-01-24T12:02:17Z")

</div>

- [Forum.Processing.org/two/discussion/16053/p5-gif-question](http://Forum.Processing.org/two/discussion/16053/p5-gif-question)

---

<div class="post-metadata">

**Author:** ![jgl](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jgl/32/3401_2.png) [@jgl](https://discourse.processing.org/u/jgl)\
**Post date:** [January 24, 2019, 4:44pm UTC](https://discourse.processing.org/t/getting-p5-gif-js-working-in-the-p5-js-web-editor/7787/3 "2019-01-24T16:44:13Z")

</div>

Thanks for this, were you referring to the already old bug filed on the repo for the library?

> <https://github.com/antiboredom/p5.gif.js/issues/1>

Or something else? It also errors in Chrome:

“Uncaught DOMException: Failed to execute ‘drawImage’ on ‘CanvasRenderingContext2D’: The image argument is a canvas element with a width or height of 0.”
