# Using Images From URLs

**URL:** <https://discourse.processing.org/t/using-images-from-urls/39191>\
**Category:** Beginners\
**Created:** [October 10, 2022, 9:52am UTC](https://discourse.processing.org/t/using-images-from-urls/39191 "2022-10-10T09:52:46Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [October 10, 2022, 10:21am UTC](https://discourse.processing.org/t/using-images-from-urls/39191/4 "2022-10-10T10:21:37Z")

</div>

Hi @s31,

This is an issue with the [CORS policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).

You can read more about it on those previous threads:

> [@Fetch API cannot load file](https://discourse.processing.org/t/fetch-api-cannot-load-file/3261/7):
>
> Ah, CORS, so we meet again. When trying to access resources (especially in any browser other than Firefox) in a developer-y way, you will often also be doing things that look remarkably like what bad actors do who spoof websites, steal identities, pass viruses, run bot-nets etc – one aspect of which is sometimes called “cross-site scripting,” although suspicious crossings can also be local to a client. CORS (Cross-Origin Resource Sharing) is one of the security measures that prevents you from …

> [@API POST error - not sure what's causing it](https://discourse.processing.org/t/api-post-error-not-sure-whats-causing-it/29311/2):
>
> Hi, If I run the code in the [p5 web editor](https://editor.p5js.org/), I get this error : TypeError {stack: ""} This is somehow cryptic and I don’t really know what is the formatting behind this. However the httpPost function is using the [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) function [behind the scenes](https://github.com/processing/p5.js/blob/0ee26327802f3afc7b0b2591e6c5667c986d8f21/src/io/files.js#L1104) and I tried running that in a new tab (in Firefox): fetch('http://colormind.io/api/', {method: 'POST', body: postData}) .then(data =\> data.json()) .then(json =\> console.log(json)) .catch(err =\> console.log(err)); And effectively there…

EDIT:

as @mnse said, it’s the url that is not the right one, it’s explained in this SO thread how you can get a direct link to an Imgur image:

> <https://webapps.stackexchange.com/questions/95883/how-to-get-direct-link-of-images-on-imgur>

---

_[View the full topic](https://discourse.processing.org/t/using-images-from-urls/39191)._
