Unable to upload/display images
Within a card, I have tried:
- Click "Image (Ctrl-G)" - "Browse" or drag/paste in a image > I can see image preview now > Click "Add image"
- Result: card is immediately closed, and nothing is added to the content
- Click "Image (Ctrl-G)" - "Browse" or drag in a image > I can see image preview now > Drag this preview image into content below
- Result: getting a super long string starting with
data:image, but not displayed as a image in rich text mode.
- Result: getting a super long string starting with
The only way I can add image now is by linking from another website. But on the server I can see that image added above are indeed uploaded to config/images. It just can't be displayed, or am I doing things wrong?
Sorry for the delay. Are you running the app through docker? If so, could you please share your container info? (or the command you used to create the container)
Thanks for your reply.
Yes I am running it through docker. Here is the compose:
services:
tasks.md:
image: baldissaramatheus/tasks.md
container_name: tasks.md
environment:
- PUID=1000
- PGID=1000
volumes:
- ./tmd/tasks:/tasks
- ./tmd/config:/config
restart: always
ports:
- 9999:8080
I can confirm the the upload happens (and succeeds) when user clicks "Add image". But then the card just closes.
I also tried the demo provided by Stacks-Editor. When you click "Add image" there, the relevent image syntax is added to the text.
Hey, just submitted a new release with the fix. Could you please pull the new image and try again when you're available?
Can confirm the fix works with latest docker image!
So I did some testing and here is what I've found:
Upload no longer cause card to close, thanks!
But there are a few behaviors you may want to consider look into:
- If you upload a image with spaces in its name, going to markdown mode will cause the
[ ]brackets to in the image syntax be escaped\[ \]somehow, and thus not showing the image. The default behavior of Stacks-Editor is to replace any space in the image link with%20. You can see this at work if you upload a image with spaces in rich text mode and click on the image to edit the description. - Maybe consider renaming the images during upload so that they all have unique and URL safe names? Currently, if you upload another image with the same name, it will override the file on the server and affects other card using that image.
- The hostname part of the image URL is not really necessary and can potentially cause problem if people change their Task.md subdomain in their reverse proxy. The image displays just fine if I change the URL to just
/api/images/some_image.png
I am not sure if these are more of issues of the upstream Stacks-Editor. Thanks for fixing the upload problem.