You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for develop this tool, I want to transfer some j2c buffer into image buffer (eventually to base64 for img display). I tried to add this module into my electron project, but a error show up.
abort(CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0). Build with -s ASSERTIONS=1 for more info.
Do you have any suggestions on how I can fix this? Also, do you know other javascript (node) tool that can do the j2c-image-base64 conversion?
3c 21 44 4f translates to <!DO, so it looks like you were trying to load (using WebAssembly.instantiateStreaming()?) an HTML file (that starts with <!DOCTYPE HTML...) instead of a WebAssembly file.
Thanks for your previous answer, yes I finally found it's my electron setting up thing. However, I am still struggle to get openhtjs work in my electron App.
For example, I installed library with npm, then encountered problem to read:
I put this line in my react file:
import { Decoder } from "openht/dist/HT";
Then encounter this error.
Failed to compile.
[0]
[0] ./node_modules/openht/dist/HT.js 16:17
[0] Module parse failed: Cannot use keyword 'await' outside an async function (16:17)
[0] File was processed with these loaders:
[0] * ./node_modules/babel-loader/lib/index.js
[0] You may need an additional loader to handle the result of these loaders.
[0] | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[0] | import makeHTCodec from './HT_internal.js';
[0] > const ht_codec = await makeHTCodec();
[0] |
[0] | ht_codec.HTDecoder.prototype.decodeToRGBAArray = function (array_buffer, decompositionLevel = 0) {
Could you provide an example, like load library, read a jp2 image, convert it into jpg. (Actually, my initial plan is to directly convert jp2 binary to base64 string of jpg, but never mind, I can't get any js solution work for JP2 conversation now).
Activity
palemieux commentedon Sep 23, 2021
3c 21 44 4ftranslates to<!DO, so it looks like you were trying to load (usingWebAssembly.instantiateStreaming()?) an HTML file (that starts with<!DOCTYPE HTML...) instead of a WebAssembly file.YuanTian1991 commentedon Oct 9, 2021
Thanks for your previous answer, yes I finally found it's my electron setting up thing. However, I am still struggle to get openhtjs work in my electron App.
For example, I installed library with npm, then encountered problem to read:
I put this line in my react file:
Then encounter this error.
Could you provide an example, like load library, read a jp2 image, convert it into jpg. (Actually, my initial plan is to directly convert jp2 binary to base64 string of jpg, but never mind, I can't get any js solution work for JP2 conversation now).
YuanTian1991 commentedon Oct 9, 2021
Sorry, I just found your example here. Will try to follow.