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

fix(loaders): properly catches render errors and call `onError` callback #18

Closed daniele-pelagatti closed 7 months ago

daniele-pelagatti commented 7 months ago

related issue: #16

the problem is caused by the fact that an empty string or any other "real-file-but-not-an-image" (an empty string is a request to load index.html basically) gets fulfilled by the server with a 200 OK status, returned by FileLoader -> we get the HTML in return (which is not an image) and then we try to render it anyway.

this catches errors in the LoaderBase render function and properly calls the onError callback