Zavy86 / WikiDocs

📗 Just a databaseless markdown flat-file wiki engine
https://www.wikidocs.it
MIT License
297 stars 43 forks source link

images don't show up #30

Closed aguaviva closed 1 year ago

aguaviva commented 2 years ago

They get uploaded and saved in the folder of the page but they don't show up

Zavy86 commented 2 years ago

can you try in the online demo?

raulamd commented 2 years ago

Pasting an image works fine in the online demo. Dropping an image didn't work though.

So glad to see this project is alive!! :)

Zavy86 commented 2 years ago

Hi, I have try in the online demo both with paste and browse from file and it works. What is the file extension that are you trying to upload?

serial commented 2 years ago

Hi guys, I have also tested it in the online demo.

Zavy what did you mean by saying "browse from file works", you mean the dropping into the editor is working on your side?

It seems that there are some different actions:

  1. Copy via hotkeys from clipboard to the editor. This is handled by the images.js (window.addEventListener("paste",function(e)...)
  2. Dropping files (drag n drop) into the editor, commonly this is handled by the editor itself. I couldn`t find any listener in the images.js for this.
  3. Editor upload dialog (not active, not tested)

If you enable uploadImage: true in the editor.js And if you now try to paste from clipboard, for example from the snipping tool

  1. It comes an alert.error dialog which says: "Something went wrong when uploading the image <filename>.<filetype>.
  2. The console is showing: "EasyMDE: The server did not return a valid json.".
  3. You can see your catched error from your images.js which is: {"error":null,"code":"image_uploaded","name":"62c74fa1982e664783dcab885948324d.png","path":"\/documents\/testing\/62c74fa1982e664783dcab885948324d.png","size":22211}
    • As result the image is created (submit.php?act=image_upload_ajax) in the folder and the link is inserted as expected.

Unfortunately, I haven't had time to analyze it in more detail at the moment, but maybe it points you in the right direction of the image.js file.

Zavy86 commented 2 years ago

to upload an image you can use the blue icon in the top right of the edit page. in this modal window you can browser an image from your file system and upload It. drag and drop feature is not enable at this moment.

serial commented 2 years ago

Ok, now I understand. The blue image-icon button is working perfectly! Then aguaviva means the uploaded images below the browse dialog?

aguaviva commented 2 years ago

I meant that

Zavy86 commented 1 year ago

drag and drop feature is not implemented yet

aguaviva commented 1 year ago

Note that if you flag it as "completed" it means that the issue has been fixed/implemented. Note that the front page still claims this is an existing feature, you may want to under-promise and over-deliver (and not the other way around)

aguaviva commented 1 year ago

This is still happening as of today.