# Image not recognized

**URL:** <https://discourse.processing.org/t/image-not-recognized/20912>\
**Category:** Beginners\
**Created:** [May 15, 2020, 3:33pm UTC](https://discourse.processing.org/t/image-not-recognized/20912 "2020-05-15T15:33:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![virtuous1](https://avatars.discourse-cdn.com/v4/letter/v/b9bd4f/32.png) [@virtuous1](https://discourse.processing.org/u/virtuous1)\
**Post date:** [May 15, 2020, 3:33pm UTC](https://discourse.processing.org/t/image-not-recognized/20912/1 "2020-05-15T15:33:58Z")

</div>

Hello I was to create a sketch in [p5js](https://p5js.org/) in the [atom editor](https://atom.io/). As part of it I tried to upload an image and I got this error:

```auto
Refused to execute script from 'http://127.0.0.1:3000/Draw-Pixel/MyGame.png' because its MIME type ('image/png') is not executable.

```

i tried this with JPEG, JPG, PNG and XCEF, and I always got the same error (of course the file extension and name changed). I don’t have p5 DOM installed I don’t know if that means anything, It didn’t come when I downloaded [p5js complete](https://p5js.org/download/).  
Please help soon.  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/6a5e0f6a8b42ebb6600a0cf7a42d78392e42c81f.png)

 ![script](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/3/3a03a9f24b8d12a41590bc3c2bf2417291f7dba8.png) ![error](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/e/e128093cf480d0cd8a2a3f677a9cef0999e4c31a.png) ![libraries](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/3/3515b05ad2bdbc5d1d06076ef51b148ac0afec7a.png)  
 ![pic](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/f/f188f136a957539e38bdd86217c466852e96a4a2.png)  
 ![HTML](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/0/0e7d57a5d44ff0f7baa69eaa651c47e1098a0a6e.png)

---

<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 15, 2020, 5:15pm UTC](https://discourse.processing.org/t/image-not-recognized/20912/2 "2020-05-15T17:15:37Z")

</div>

Hello,

This line in `index.html` makes the browser download that image and try parsing it as JavaScript. That will fail miserably, and that’s why the error shows up.

```auto
<script src="MyGame.png"></script>

```

---

<div class="post-metadata">

**Author:** ![virtuous1](https://avatars.discourse-cdn.com/v4/letter/v/b9bd4f/32.png) [@virtuous1](https://discourse.processing.org/u/virtuous1)\
**Post date:** [May 15, 2020, 8:14pm UTC](https://discourse.processing.org/t/image-not-recognized/20912/3 "2020-05-15T20:14:48Z")

</div>

Thank you @Sven.  
So what is the correct do it?

---

<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 15, 2020, 8:32pm UTC](https://discourse.processing.org/t/image-not-recognized/20912/4 "2020-05-15T20:32:29Z")

</div>

Remove that line of HTML. It makes no sense, including an image as a script. What is it that you’re trying to accomplish with that?

---

<div class="post-metadata">

**Author:** ![virtuous1](https://avatars.discourse-cdn.com/v4/letter/v/b9bd4f/32.png) [@virtuous1](https://discourse.processing.org/u/virtuous1)\
**Post date:** [May 15, 2020, 9:02pm UTC](https://discourse.processing.org/t/image-not-recognized/20912/5 "2020-05-15T21:02:16Z")

</div>

Oh my god it worked!  
Thank you so much. 👍

---

<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 16, 2020, 10:08am UTC](https://discourse.processing.org/t/image-not-recognized/20912/6 "2020-05-16T10:08:40Z")

</div>

You’re most welcome, @virtuous1. 😊 If you don’t mind me asking, can you remember why that line of HTML was put there in the first place?

---

<div class="post-metadata">

**Author:** ![virtuous1](https://avatars.discourse-cdn.com/v4/letter/v/b9bd4f/32.png) [@virtuous1](https://discourse.processing.org/u/virtuous1)\
**Post date:** [May 17, 2020, 1:48am UTC](https://discourse.processing.org/t/image-not-recognized/20912/7 "2020-05-17T01:48:58Z")

</div>

Yeah I was watching this tutorial on how to add an image to p5js and I think they said (or I misunderstood that they said) to put in that line in HTML, I don’t even remember where I saw it.  
Maybe it was a [coding train](https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1_aw) video?  
🤷‍♂️  
Either way thanks.
