I'm trying to embed an explanatory image in a markdown cell.
At the top of the cell there's an 'Insert image' button that puts the code  into the cell.
It works for images hosted on the web, like for example from Wikimedia Commons.
On Google Drive you can right-click on a file and select 'Get shareable link' which gives you a link using which anyone can view the file (like say an image file).
But this link can't be used to display an image in a Colab markdown cell.
I'm using Google Chrome.
Example notebook: https://colab.research.google.com/drive/19Qe70fDD2XUP8LdWYnUQuUko5oT98Euy
I don't think there's anything colab-specific here; it looks like you got it figured out based on your notebook. (Your solution also seems to match this SO question.)
If an image is on your clipboard you can also use ‘paste’ to paste the
base64 data into the markdown.
On Sun, Dec 1, 2019 at 3:49 PM Craig Citro notifications@github.com wrote:
I don't think there's anything colab-specific here; it looks like you got
it figured out based on your notebook. (Your solution also seems to match this
SO question https://stackoverflow.com/a/11855448.)—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/googlecolab/colabtools/issues/882?email_source=notifications&email_token=AJCRJKWVA54ORROX2KYVJXLQWRESNA5CNFSM4JSP5GK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFRZXOI#issuecomment-560176057,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJCRJKXGLNB4GC42KNBOGLLQWRESNANCNFSM4JSP5GKQ
.--
You received this message because you are subscribed to the Google Groups
"colaboratory-team" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To view this discussion on the web visit
https://groups.google.com/a/google.com/d/msgid/colaboratory-team/googlecolab/colabtools/issues/882/560176057%40github.com
https://groups.google.com/a/google.com/d/msgid/colaboratory-team/googlecolab/colabtools/issues/882/560176057%40github.com?utm_medium=email&utm_source=footer
.
I don't think there's anything colab-specific here; it looks like you got it figured out based on your notebook.
The notebook has three attempts at inserting images. The one hosted on wiki commons works, the ones on Google Drive don't. That's sort of the problem :-)
(Your solution also seems to match this SO question.)
That and many others, but none of their solutions work for images on Google Drive. This could be an issue on GDrive's side though.
If an image is on your clipboard you can also use ‘paste’ to paste the base64 data into the markdown.
That works, thanks! Though it puts a wall of text in my markdown cell. Still, I understand this is a low priority issue (or working as intended?) so won't press any further. Appreciate the work y'all're doing.
I was able to get a photo from Drive working by:
The URL should look like: https://drive.google.com/open?id=XXXXXX
Then grab the ID from that URL then for the URL in the notebook, use:
http://drive.google.com/uc?export=view&id=XXXXXX
Just to confirm: the embedded uc link in that notebook works when I open it.
Is that not the case for everyone else?
Un-blocking third party cookies made the images appear for me - those with 'open?id' replaced with 'uc?id' and with 'uc?export=view&id'. The change is immediate, without having to reload. I'm on Google Chrome.
Apologies, and thanks!
I was able to get a photo from Drive working by:
- Upload the image to Drive.
- Right-click on the file in Drive, choose 'Get sharable link'.
The URL should look like: https://drive.google.com/open?id=XXXXXX
Then grab the ID from that URL then for the URL in the notebook, use:
http://drive.google.com/uc?export=view&id=XXXXXX
This really help me a lot, well, I'll mention one more point here(in case someone need it), if you are embedding an non-image file to markdown, you can use:
http://drive.google.com/uc?export=download&id=XXXXXX
Most helpful comment
I was able to get a photo from Drive working by:
The URL should look like: https://drive.google.com/open?id=XXXXXX
Then grab the ID from that URL then for the URL in the notebook, use:
http://drive.google.com/uc?export=view&id=XXXXXX