bitbof / klecks

Community funded painting tool powering Kleki.com
https://klecks.org
MIT License
220 stars 69 forks source link

In examples/ embed /, there is only an example of how to save the image locally. #3

Closed satopian closed 2 years ago

satopian commented 2 years ago

Hello. There were many users of this app on 2Draw.net. Therefore, I wanted to use embed version and use it like 2Draw.net. However, the example only has an example of submit → (PNG / PSD) download. I managed to post them with ajax and save them on the server, but I don't know how to load the PSD data from the server to correct the picture I drew. 2Draw.net seems to implement them with a concise source, but it doesn't work even if I write it in the same way. How can I load the PSD data into a layer? It is the task of modifying the data once stored on the server. If I can load into a layer and post from there, I can do what I want to do. If you can tell me, thank you.

https://paintbbs.sakura.ne.jp/cgi/neosample/petitnote/ ↑ An electronic bulletin board where i can draw and post pictures with klecks. However, i cannot edit the picture i drew at this time.

bitbof commented 2 years ago

Hi, I've added PSD reading to the embed example just now. I hope it works for you. Also cool to see Klecks in another community!

satopian commented 2 years ago

I was able to draw and post a picture, then draw a continuation from that PSD and edit the image. Thank you for your valuable information. The following may be unique to 2draw, so If this question isn't right for you, it's okay if you don't have an answer, but let me just ask. This time I wrote a fairly long JavaScript to upload PNG and PSD. However, I thought maybe there was a way to upload it concisely from the beginning. For example, take a small part of the 2draw source as an example.

new Kleki ({{
    canvasWidth: "300",
    canvasHeight: "300",
    uploadUrl: "https://example.com/",
onDownloadFailure: (error) => {

It looks like this. But what I was able to write https://paintbbs.sakura.ne.jp/petit/cgi/template/basic/paint_klecks.html It was a long writing style like.

If there is an example that can be uploaded concisely, it will be easy for various people to use if it is described in the example.

There is no help file after build. Is this a specification?

Is it possible to bundle the built klecks with the script on the drawing board and redistribute it? If it is possible, it can be used by the end user of the drawing board, not the developer. This is because we are developing and distributing a drawing bulletin board that anyone can easily install. Is it possible to have the built klecks bundled with the script on the drawing board and allowed to be redistributed?

Naturally, I'll include the LICENCE file to make it clear that it's bitbof's code. I apologize for the long sentence at the end.

bitbof commented 2 years ago

Hi, I created a custom solution for 2draw that includes uploading out of the box. Since every site might have a different API for uploading I didn't include it in Klecks, but I could add an example. It's not much shorter than what you have.

You could extend app/script/embed/bootstrap/embed-wrapper.ts with the uploading functionality for your specific board, so the html page is cleaner.

By "help file" do you mean the help page which explains shortcuts etc. (when clicking on the questionmark)? That's indeed still missing. I will add a help page shortly.

Feel free to redistribute it!

satopian commented 2 years ago

By "help file" do you mean the help page which explains shortcuts etc. (when clicking on the questionmark)? That's indeed still missing. I will add a help page shortly.

yes. Wait for the help file to be created.

Feel free to redistribute it!

Thank you. I will bundle the klecks built in "Petit Note" and "POTI-board".

app/script/embed/bootstrap/embed-wrapper.ts

I will check it. thank you.