syoyo/tinyexr

Javascript TinyEXR throw Assertion failed error on my .exr file

remmel opened this issue · 2 comments

Running the html sample with my exr image 1374184918_depthMap.exr throws that error:

tinyexr.html:1 Uncaught (in promise) : ret, at: ../../tinyexr.h,9397,DecodePixelData at Error
    at jsStackTrace (https://localhost:9000/js/tinyexr.js:1:17999)
    at stackTrace (https://localhost:9000/js/tinyexr.js:1:18170)
    at ___assert_fail (https://localhost:9000/js/tinyexr.js:1:81772)
    at Ze (https://localhost:9000/js/tinyexr.js:8:55332)
    at Cd (https://localhost:9000/js/tinyexr.js:8:37098)
    at od (https://localhost:9000/js/tinyexr.js:8:32469)
    at kd (https://localhost:9000/js/tinyexr.js:8:30898)
    at id (https://localhost:9000/js/tinyexr.js:8:29452)
    at Yh (https://localhost:9000/js/tinyexr.js:8:82801)
    at Rh (https://localhost:9000/js/tinyexr.js:8:81932)
Promise.then (async)
(anonymous) @ tinyexr.html:21

Using the other image 1374184918_simMap.exr throws another error:

Uncaught (in promise) DOMException: Failed to construct 'ImageData': The requested image size exceeds the supported range.

Files : exr.zip

Note that the images are fetched properly (as If the image is missing the lib with throw same message error Failed to construct 'ImageData'...)

Note that the html sample works correctly with asakusa.exr (but not with mine exr file).

Environment

  • OS: Ubuntu 20.04.2 LTS
  • Chrome 91.0.4472.114
syoyo commented

This will be an issue of WebAssembly. Increasing or adjusting memory parameter in emcc(e.g. TOTAL_MEMORY) may solve the issue.

syoyo commented

Increasing TOTAL_MEMORY or use ALLOW_MEMORY_GROWTH=1 should solve the issue