Upload paper.js as PNG to Amazon AWS/S3

51 views
Skip to first unread message

pascal....@gmail.com

unread,
Apr 14, 2017, 1:53:39 PM4/14/17
to Paper.js
Hi paper fans!

I would like to upload paper.js projects as PNG to Amazon AWS/S3.

For this, I would like to avoid storing the PNG in the file system of the server but instead pass some image file to the S3 SDK.

What is the best format that I could obtain from paper.js to be used for the S3 SDK?
  • The S3 SDK allows the following datatypes to be uploaded:
    • Buffer
    • Typed Array
    • Blob
    • String
    • ReadableStream

How would I obtain that datatype (WITHOUT storing in the file system first such as by exporting to *.png and then reading it in again)?

Many thanks for any help!

Pascal

pascal....@gmail.com

unread,
Apr 14, 2017, 2:54:11 PM4/14/17
to Paper.js
I was able to do it using toBuffer().

pascal....@gmail.com

unread,
Apr 14, 2017, 4:17:19 PM4/14/17
to Paper.js
It looks like my generated paper projects have a different alignment when I write them toBuffer() compared to when I export them as SVGs.
The fit to bounds function does not work / gets ignored.



On Friday, 14 April 2017 18:53:39 UTC+1, pascal....@gmail.com wrote:

Jürg Lehni

unread,
Apr 15, 2017, 6:59:54 AM4/15/17
to pap...@googlegroups.com
If you think it is a bug, please create a reduced test case and post it to:


Thanks!

J

--
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.

Reply all
Reply to author
Forward
0 new messages