Gist: How are images uploaded to a gist?
Here is the image file: https://gist.github.com/mbostock/5503544#file-thumbnail-png
I tried to drag-and-drop the image file in the edit mode of a gist. That didn't seem to work in Chrome and FireFox.
Update: After back and forth emails with GitHub, this feature (drag-and-drop binary files, including images) isn't supported.
Solution 1:
With a little creativity you can achieve this faster than cloning. To drag/drop:
- Create the Gist
- Drag an image into the comment field below. This will auto-upload your image file to
https://user-images.githubusercontent.com
and insert markdown code in the comment field to display the image. - Copy this markdown code to your gist
Note: It is not required that you submit the comment.
Live example
Solution 2:
I was looking for answer for the same question, here is what I just found:
You can clone your gist as a git repository and add your picture, then push to origin. See loading-thumbnail-into-gist-for.
There is a script written to do this: hecticjeff/gist-img.
I have not tried the above solutions yet, but pretty sure they should work. I did try using defunkt/gist to update my gist with a png but ended up displaying a binary file in my gist.