KnicKnic / WASM-ImageMagick

Webassembly compilation of https://github.com/ImageMagick/ImageMagick & samples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maximum call stack size exceeded on iOS Safari

pieper opened this issue Β· comments

(neat project! πŸ‘ )

Things work great for me on desktop machines, but not on mobile (ios safari).

For example the rotate example results in the stack trace below.

It looks like magick-wasm doesn't have this issue and may work for me, so I'm going to explore that. I wouldn't have found that project without reading your issues so thanks for sharing your development in the open.

exception thrown: RangeError: Maximum call stack size exceeded.,<?>.wasm-function[194]@[wasm code]
<?>.wasm-function[2078]@[wasm code]
wasm-stub@[native code]
https://knicknic.github.io/wasm-imagemagick/magick.js:131:120835
invoke_iiiiiii@https://knicknic.github.io/wasm-imagemagick/magick.js:131:113258
<?>.wasm-function[2078]@[wasm code]
<?>.wasm-function[1525]@[wasm code]
<?>.wasm-function[2996]@[wasm code]
<?>.wasm-function[436]@[wasm code]
<?>.wasm-function[636]@[wasm code]
<?>.wasm-function[2811]@[wasm code]
<?>.wasm-function[2805]@[wasm code]
<?>.wasm-function[1962]@[wasm code]
wasm-stub@[wasm code]
bb@[native code]
https://knicknic.github.io/wasm-imagemagick/magick.js:131:119263
callMain@https://knicknic.github.io/wasm-imagemagick/magick.js:131:123423
processFiles@https://knicknic.github.io/wasm-imagemagick/magick.js:75:22
https://knicknic.github.io/wasm-imagemagick/magick.js:48:17
doRun@https://knicknic.github.io/wasm-imagemagick/magick.js:131:124045
run@https://knicknic.github.io/wasm-imagemagick/magick.js:131:124268
runCaller@https://knicknic.github.io/wasm-imagemagick/magick.js:131:123045
removeRunDependency@https://knicknic.github.io/wasm-imagemagick/magick.js:131:12921
receiveInstance@https://knicknic.github.io/wasm-imagemagick/magick.js:131:14203
receiveInstantiatedSource@https://knicknic.github.io/wasm-imagemagick/magick.js:131:14492
promiseReactionJob@[native code]

hrm... I should probably just go an upload a different version of wasm-imagemagick to fix the sample.

I do use compiled versions for the following pages that do work on mobile safari.
See https://knicknic.github.io/imagemagick/ (cool page that lets you create links to arbitrary imagemagick commands and save them). The page even works offline.

a website for splitting comics (why I made this library). https://knicknic.github.io/croppy/

As for JS libraries wrapping imagemagick, I would also recommend https://github.com/dlemstra/Magick.WASM .

Thanks for getting back to me. After some playing around I decided to just rebuild your project from scratch, and after making a few changes it ended up working well. We are using it for our chest X-ray experiments (see https://acil-bwh.github.io/slowdown-covid19).

Here are the changes I made to the build:

covictory@b61d39e

I also hacked up the magic.js to suit my needs. I know that's bad form, but I was a little tired of emscripten at that point and just wanted things to work : ). The edits are flagged with "COVICTORY" in comments.

https://github.com/covictory/site/blob/master/cxr/thirdparty/magick.js

Thanks again,
Steve

this seems to be working as of latest release, see https://knicknic.github.io/imagemagick/rotate/