Skip to content

webgl-image-processing: images don't actually have to be same-origin #433

Open
@okyanusoz

Description

@okyanusoz

Here:
var image = new Image();
image.src = "https://webglfundamentals.org/webgl/resources/leaves.jpg"; // MUST BE SAME DOMAIN!!!

This is incorrect. You can use:
var image = new Image();
image.crossOrigin = "*" // or crossOrigin = "anonymous"
image.src = "https://picsum.photos/300/500"; // try it, this works!

The only caveat is that credentials are omitted, but I think that's acceptable.

Activity

linked a pull request that will close this issue on Aug 11, 2023
jan-ale

jan-ale commented on Aug 10, 2024

@jan-ale

only if the cross-origin site gives cors headers. there's an article about it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @okyanusoz@jan-ale

      Issue actions

        webgl-image-processing: images don't actually have to be same-origin · Issue #433 · gfxfundamentals/webgl-fundamentals