MONOGRID / gainmap-js

A Javascript (TypeScript) Port of Adobe Gainmap Technology for storing HDR Images using an SDR Image + a gainmap
https://monogrid.github.io/gainmap-js/
MIT License
70 stars 5 forks source link

Decoder hang with invalid URL #16

Closed elalish closed 7 months ago

elalish commented 7 months ago

We have a test that's now failing upon incorporating HDRJPGLoader in https://github.com/google/model-viewer/pull/4578:

test('throws on invalid URL', async () => {
      try {
        await textureUtils.loadEquirect('');
        expect(false).to.be.ok;
      } catch (e) {
        expect(true).to.be.ok;
      }
    });

It appears to time out reliably, so I think it's just hanging instead of throwing? Our similar test for a not found URL is throwing properly: await textureUtils.loadEquirect('./nope.png');

elalish commented 7 months ago

Also, it's interesting to note that HDRJPGLoader successfully loads not just SDR JPEG images, but also PNGs (which is great!). However, it makes the name slightly misleading...

daniele-pelagatti commented 7 months ago

I'm getting a proper error thrown when trying to load an invalid url in the three.js example:

with both the sync method image

and the async one image

I need to investigate this further

daniele-pelagatti commented 7 months ago

ahhh, right, nevermind my previous comment, I misread your report, this seems to happens only with an empty string, I can reproduce the problem now, I'm investigating

daniele-pelagatti commented 7 months ago

this should be fixed in v3.0.0