Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Could not load <image url> (sandbox example) #220

Open
rdecapomaranca opened this issue May 7, 2019 · 3 comments
Open

Could not load <image url> (sandbox example) #220

rdecapomaranca opened this issue May 7, 2019 · 3 comments

Comments

@rdecapomaranca
Copy link

Hi.

I pasted the following svg code in the Sandbox:

<svg _ngcontent-c4="" xmlns="http://www.w3.org/2000/svg" width="637" height="401"> <image _ngcontent-c4="" xlink:href="http://www.simpleimageresizer.com/static/images/simple-image-resizer-128x128.png" y="7" width="34" height="34" x="51"> </image> </svg>

On "Preview" I get the correct output but in console I get an error:
Error: Could not load http://www.simpleimageresizer.com/static/images/simple-image-resizer-128x128.png?t=1557241604986

And on "Save as PNG" nothing happens just the console outputs the same error again.

Any idea on why this happens?

Thank you,
Nika

@ligaz
Copy link
Contributor

ligaz commented May 8, 2019

It looks like it is a CORS issue. simpleimageresizer.com is not serving the allow origin header for the image.

Quoting MDN:

If the server does not give credentials to the origin site (by not setting the Access-Control-Allow-Origin HTTP header), the image will be tainted and its usage restricted.

@rdecapomaranca
Copy link
Author

But doesn't that mean that the image shouldn't have loaded at all? Because when looking at the Network section (see image below), the image is loaded successfully on both "Preview" and "Save as PNG". I would expect and error if it was a CORS issue.

Screenshot

@ligaz
Copy link
Contributor

ligaz commented May 8, 2019

It's a JavaScript error. You can examine it in the Console tab.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants