# P5.js - not displaying static gif image

**URL:** <https://discourse.processing.org/t/p5-js-not-displaying-static-gif-image/20948>\
**Category:** Coding Questions\
**Created:** [May 16, 2020, 7:33pm UTC](https://discourse.processing.org/t/p5-js-not-displaying-static-gif-image/20948 "2020-05-16T19:33:27Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![Sven](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sven/32/8293_2.png) [@Sven](https://discourse.processing.org/u/Sven)\
**Post date:** [May 21, 2020, 10:55pm UTC](https://discourse.processing.org/t/p5-js-not-displaying-static-gif-image/20948/19 "2020-05-21T22:55:54Z")

</div>

Hello @Chrissy,

In relation to the age of the p5.js project and speed of development, that book is pretty old (2015). It is reasonable to expect some compatibility issues when running code examples from that time on the latest version of the p5.js library.

That said: the example does work fine as long as you serve the sketch via a web server (not from the local file system). I recently explained why it isn’t working locally in another thread:

> [@Looking for help downloading from editor with interactive sketch](https://discourse.processing.org/t/looking-for-help-downloading-from-editor-with-interactive-sketch/20669/3):
>
> This has to do with how `loadImage` and `loadSound` are implemented. The functions use something called Fetch API and have that configured in such a way that downloading of files isn’t allowed locally. Believe it or not, it’s related to security.
> 
> There’s not much you can do about it really (except patching p5.js). Running a web server (locally or elsewhere) as you did is the way to go.
> 
> If you’re interested in the technical details, read up on [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) and [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).

Your options (in order of my preference) are:

- [Run a web server on your local machine](https://github.com/processing/p5.js/wiki/Local-server).
- Configure your web browser to allow access to local files (if that’s supported in your browser).
- Run an older version of the p5.js library (as you figured out yourself).
- Avoid `loadImage` as a workaround (as @everythingability suggested).

---

_[View the full topic](https://discourse.processing.org/t/p5-js-not-displaying-static-gif-image/20948)._
