Closed FallingSnow closed 7 years ago
I haven't tested / developed support for webworkers yet. It shouldn't be too complicated, but I don't think it will be very trivial either.
Might be sometime before I get to this. PRs welcome :smile:
I actually did manage to get it to work by adding var window = self
to the beginning of the PolyFlif.js file itself and removing the section referring to document. However it doesn't seem to manipulate the canvas correctly when used with canvas-webworker
. All the imagedata is set to 0. Since this is the only library that allows me to use a canvas in webworkers I feel I've hit a dead end.
I have finally got it done using https://github.com/SaschaNaz/libflif.js but it is
I am trying to get back into development but, FWIW, I am stuck at getting the latest emscripten to compile on Linux :confounded:
How I would approach this without modifying the library:
Is it possible to decode a flif in a web worker? I'm using canvas-webworker with webpack in a web worker but keep running into this issue:
Cannot set property 'PolyFlif' of undefined
.The referenced line is:
at window.PolyFlif.
I've tried adding
let window = self
before importing the script but it seems to have no effect.