# Issue with loading images

**URL:** <https://discourse.processing.org/t/issue-with-loading-images/5061>\
**Category:** Coding Questions\
**Created:** [October 31, 2018, 4:46pm UTC](https://discourse.processing.org/t/issue-with-loading-images/5061 "2018-10-31T16:46:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Quillbert1](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@Quillbert1](https://discourse.processing.org/u/Quillbert1)\
**Post date:** [October 31, 2018, 4:46pm UTC](https://discourse.processing.org/t/issue-with-loading-images/5061/1 "2018-10-31T16:46:03Z")

</div>

When I run this program with the editor, it works fine. But when I download the files and try to use Chrome to run the program, it just says “Loading…” but it never loads. It works fine in other browsers.

[https://editor.p5js.org/Quillbert/sketches/BkrXo8P3m](https://editor.p5js.org/Quillbert/sketches/BkrXo8P3m)

How do I fix this?

---

<div class="post-metadata">

**Author:** ![Quillbert1](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@Quillbert1](https://discourse.processing.org/u/Quillbert1)\
**Post date:** [October 31, 2018, 11:34pm UTC](https://discourse.processing.org/t/issue-with-loading-images/5061/2 "2018-10-31T23:34:52Z")

</div>

BUMP

Adding stuff to exceed character minimum.

---

<div class="post-metadata">

**Author:** ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)\
**Post date:** [November 1, 2018, 12:04am UTC](https://discourse.processing.org/t/issue-with-loading-images/5061/3 "2018-11-01T00:04:55Z")

</div>

The sketch works online. Okay. But not locally?  
Can you run P5.js examples without issue?  
What errors (if any) are showing in the Chrome Console? (Hit F12).

---

<div class="post-metadata">

**Author:** ![Quillbert1](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@Quillbert1](https://discourse.processing.org/u/Quillbert1)\
**Post date:** [November 1, 2018, 2:05am UTC](https://discourse.processing.org/t/issue-with-loading-images/5061/4 "2018-11-01T02:05:17Z")

</div>

I can run most p5 sketches locally, but it seems that when I try to load Images in preload, It just displays this:

![Capture(1)](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/0/0c2ca71ab39ebb3b2c7b0f235e8aca53821ae11a.png)

If I don’t do it in preload it doesn’t display the images, but it displays the rest of the sketch.

There are warnings in the console, but I get these with every sketch.

 ![Capture](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/c/c1e474e73c38e51910dde5b149c39cc07a52e6d4.png)

---

<div class="post-metadata">

**Author:** ![Lexyth](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lexyth/32/7403_2.png) [@Lexyth](https://discourse.processing.org/u/Lexyth)\
**Post date:** [November 1, 2018, 2:13am UTC](https://discourse.processing.org/t/issue-with-loading-images/5061/5 "2018-11-01T02:13:47Z")

</div>

It doesn’t get access to your image. See if you changed the String in loadImage, or if you misplaced/deleted the image in the assets folder. Or renamed the folder.  
Edit: Maybe you need to change the String to match your local path.

---

<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:** [November 1, 2018, 2:32am UTC](https://discourse.processing.org/t/issue-with-loading-images/5061/6 "2018-11-01T02:32:57Z")

</div>

[ThimbleProjects.org/gotoloop/97931/](http://ThimbleProjects.org/gotoloop/97931/)  
[ThimbleProjects.org/gotoloop/97931/sketch.js](http://ThimbleProjects.org/gotoloop/97931/sketch.js)

[![](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/5/5c60e4f3951b7c3e2bfc504027a78b51c0d84d62.jpeg) ](https://thimbleprojects.org/gotoloop/97931/assets/moonwalk.jpg)  
[![](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/5/521ab1a905a879769b2c3510406216c97e13f91b.png) ](https://thimbleprojects.org/gotoloop/97931/assets/mask.png)

---

<div class="post-metadata">

**Author:** ![Quillbert1](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@Quillbert1](https://discourse.processing.org/u/Quillbert1)\
**Post date:** [November 1, 2018, 2:48am UTC](https://discourse.processing.org/t/issue-with-loading-images/5061/7 "2018-11-01T02:48:00Z")

</div>

The path matches, it works in firefox and edge, and the image is still there. GoToLoop, your sketch works, and I tried modeling my code after yours, but It still didn’t work. Is there a way I can download the code to test it?

---

<div class="post-metadata">

**Author:** ![Quillbert1](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@Quillbert1](https://discourse.processing.org/u/Quillbert1)\
**Post date:** [November 1, 2018, 2:49am UTC](https://discourse.processing.org/t/issue-with-loading-images/5061/8 "2018-11-01T02:49:51Z")

</div>

It worked when I used a python server instead of opening the HTML file, that must be the problem. Thanks for your help!

---

<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:** [November 1, 2018, 3:01am UTC](https://discourse.processing.org/t/issue-with-loading-images/5061/9 "2018-11-01T03:01:45Z")

</div>

> [@Code 800A0404 issue](https://discourse.processing.org/t/code-800a0404-issue/2036/3):
>
> Easiest & fastest recipe to run “.js” sketches under p5.js: running_man Install any Firefox-based browser in your OS and use it to open your “index.html” file: fox_faceInstall Notepad2 or Notepad++ (or both) in your OS and use it to type in your “sketch.js” file there: scroll[https://XhmikosR.GitHub.io/notepad2-mod/](https://XhmikosR.GitHub.io/notepad2-mod/)[https://Notepad-Plus-Plus.org](https://Notepad-Plus-Plus.org) You can setup those text editors to use UTF-8 and LF line endings for better compatibility. bulbHere’s my minimum “index.html” te…

---

<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:** [November 1, 2018, 3:05am UTC](https://discourse.processing.org/t/issue-with-loading-images/5061/10 "2018-11-01T03:05:12Z")

</div>

> [@Quillbert1](#):
>
> It worked when I used a python server instead of opening the HTML file, …

> **[How to allow-file-access-from-file in Chrome on any OS](https://chrome-allow-file-access-from-file.com/)**
>
> Step By Step Instructions on how to allow access flag on Windows, Linux & Mac. Then start viewing your local application files in the browser.
