edrlab / thorium-reader

A cross platform desktop reading app, based on the Readium Desktop toolkit
https://www.edrlab.org/software/thorium-reader/
BSD 3-Clause "New" or "Revised" License
1.86k stars 157 forks source link

[POC] feat: mupdfjs with asm.js and not with wasm build to extract metadata and cover img #2671

Open panaC opened 1 day ago

panaC commented 1 day ago

https://github.com/edrlab/mupdf.js

https://web.dev/articles/what-is-webassembly#asmjs https://web.dev/articles/emscripting-a-c-library https://emscripten.org/docs/tools_reference/settings_reference.html#wasm

https://github.com/edrlab/mupdf.js/blob/928cad2fcf7db5e3bd46070f140a2713f873bb86/build.sh#L27

panaC commented 1 day ago

TODO next step : need to compile to .wasm and try to load it from scratch with this example

panaC commented 1 day ago

Note: Make sure that your .wasm files have Content-Type: application/wasm. Otherwise they will be rejected by WebAssembly.

https://github.com/edrlab/thorium-reader/blob/57a79dda7bc83fbbfdae5b1b3e33887212eb3a40/src/main/redux/sagas/app.ts#L163

https://www.electronjs.org/docs/latest/api/protocol#protocolregisterfileprotocolscheme-handler-deprecated