Possible to create Canvas Image in web workers?

462 views
Skip to first unread message

Nicholas Kyriakides

unread,
Mar 21, 2016, 9:44:06 AM3/21/16
to Paper.js
Consider this scenario.

I have multiple JSON's exported via:
project.exportJSON()

I'm wondering if it's possible to create Images out of each project in a web-worker (kind of like batch-process them all and create Images out of each).

I'm aware that web workers lack access to the DOM, therefore canvas.toDataURL() won't really work since there's no canvas, hence why I'm asking if anyone has any hack-ish idea to go about it.

Jürg Lehni

unread,
Mar 22, 2016, 5:16:41 PM3/22/16
to pap...@googlegroups.com
Yes, there is web-worker support now on the development branch, see here:


--
You received this message because you are subscribed to the Google Groups "Paper.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to paperjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

robert stevens

unread,
Oct 12, 2016, 4:57:00 AM10/12/16
to Paper.js
HI,

I would like to use a worker process to handle:


AllParts = CutByRect.divide(ImageToCut)

Will this work?


I have tried to use the Worker Example but it fails in paper-full-10-2.js with:


0x800a03f6 - JavaScript runtime error: Invalid character

I have only changed the Line

<script type="text/javascript" src="Scripts/paper-full-10-2.js"></script>

to point to a local copy of paper-full-10-2.js


I am using: paper-full-10-2.js

Is this the correct version or do I need to find the development version?

Any other pointers would be very useful.

Cheers
Rob
Reply all
Reply to author
Forward
0 new messages