Closed lyncee closed 10 years ago
Same problem here, I tried debbuging it with chrome and found this
I really don´t know how 'postMessage' work, but the bug is from the TypedNeuQuant.js file that is called. Line 431 module.exports = NeuQuant;
Any help will appreciated.
Great work from Johan Nordberg, thank you
It looks like you might be loading gif.worker.js (or gif.worker.coffee) in your HTML. It is not meant to be loaded by you - only by gif.coffee. Remove the reference to it, so that it is only loaded when a new worker is spun up.
By including gif.worker.js - which does self.onmessage, it is actually doing window.onmessage - at which point it receives all messages from all workers, and tries to render a frame from those messages - meaning any worker (that isn't a gif worker) that sends a message will cause this error to throw.
Hello Keithanus !
Thank you for the trick, it did it.
My bad I feel a bit stupid. Thank you for your follow up !
@lyncee no problem! You should close this issue.
Same here, thank you!
Hello,
I just figured out that in some points, when there is an other plugin in the page using postmessage, it has some side effects with gifjs.
I have in my page a youtube html5 player, and when gifjs is also loaded (whatever the loading order), I got this error:
Uncaught SyntaxError: Failed to execute 'postMessage' on 'Window': Invalid target origin '' in a call to 'postMessage'. GIFEncoder.js:55
I will check with some other scripts using postmessage if it does the same side effects anyway and keep you updated if I find a workaround.
Cheers guys, thank you for this awesome work.