Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check file headers instead of filename regex to determine image format #9640

Open
ebogo1 opened this issue Jun 25, 2021 · 0 comments
Open

Check file headers instead of filename regex to determine image format #9640

ebogo1 opened this issue Jun 25, 2021 · 0 comments
Labels

Comments

@ebogo1
Copy link
Contributor

ebogo1 commented Jun 25, 2021

This came up in #9513 - files like Material.js have code along the lines of:

var ktx2Regex = /\.ktx2$/i;

function createTexture2DUpdateFunction(uniformId) {
  ...

  if (ktx2Regex.test(resource.url)) {
    promise = loadKTX2(resource.url);
  } else {
    promise = resource.fetchImage();
  }

  ...
}

We should update these checks to check .ktx2 header info since not all files will have the .ktx2 extension.

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