lostintangent / gistpad

VS Code extension for managing and sharing code snippets, notes and interactive samples using GitHub Gists
https://aka.ms/gistpad
MIT License
937 stars 58 forks source link

images not working #324

Closed markj-s closed 9 months ago

markj-s commented 1 year ago

Describe the bug Images are not displaying after pasting.

To Reproduce When I paste an image into a gist, it is not getting rendered in VSCode. It instead returns a placeholder image icon as it can't seem to locate the file. The keyboard shortcut of shift +CMD + v (on Mac) also opens a preview of the gist instead of pasting. I have to use right click "paste image".

When I also try to access the image using the url location, Github returns a 404 not found error (even after saving the Gist and it has synced to my Github gists.

The only way I can get images to render is to change the GistPad > Images: Paste Type setting to base64. This however is not practical for document use whilst editing as the output is huge requiring a lot of scrolling compared to the single line output when the format is set to file.

Expected behavior Images should paste and display.

Screenshots

image

The output when I use right click paste image.

image

The output in my browser when I try to visit the url of the image.

Desktop (please complete the following information):

Additional context I have tried a fresh install of VSCode on my Mac where I only have GistPad installed (no other extensions) however the result is the same. I also had the same result on a Windows 10 laptop. Is this therefore a bug issue? If I change my markdown to use a url of an internet located image, it renders ok. It just will not work when I copy and paste images locally.

aidin-foroughi commented 1 year ago

I can confirm the same exact issue on: Windows 11. VSCode version 1.76.0 GistPad: v0.4.1 The upload starts, but the generated link leads to a 404. It appears that the "images" folder is not getting created at all either.

lostintangent commented 9 months ago

Closing this as a duplicate of #297 since the issue is related to pasting images from the clipboard.

celynw commented 7 months ago

This issue (which affects me) doesn't seem to be the same as the referenced issue #297 (though it's possible the cause is related?). When pasting the image, it says ** Uploading image XXXX...**, and after about a second it will be replaced by what looks like a valid path, e.g. ![image](https://gist.github.com/USER/LONG_ID_STRING/raw/images---DATE_SOMENUMBERS.png). Seems good. But nothing was actually uploaded.

In that other issue, the user didn't get that far.

Maybe related useful information: When I clone the gist manually and and upload images myself, gistpad shows something a bit weird with the naming. Here, I've uploaded 5 images, which show as 5 images/ directories as well as some odd recursion. The images themselves show fine though in my markdown preview in VSCode, and also on GitHub (if I use the HTML tags instead of markdown inline)

image