googlecolab / colabtools

Python libraries for Google Colaboratory
Apache License 2.0
2.21k stars 724 forks source link

Support native image insertion from file folders #2142

Open hibetterheyj opened 3 years ago

hibetterheyj commented 3 years ago

Thanks to the developers for your effort!

Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I have a series of notebooks with many pictures embedded in them, and they are placed in assets/folder under the same path of google drive. But when I use the following code to copy the image to files and then use ![]() to call in the markdown cell, but I find that the image cannot be displayed.

from google.colab import drive
drive.mount('/content/gdrive')
! cp -r 'gdrive/My Drive/<notebook-path>/assets/' .

The only solution found online is insertion via GDrive sharing links as given on this page: https://stackoverflow.com/questions/50670920/how-to-insert-an-inline-image-in-google-colaboratory-from-google-drive

Describe the solution you'd like

A clear and concise description of what you want to happen.

I would like to request a native image insertion support from file folders

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context, screenshots or notebooks about the feature request here.

cperry-goog commented 3 years ago

Thanks for the feature request!

For the time being, the best solution is render the image in an output cell using ipython.display.image, or try copying the image onto your clipboard and you can paste the image into a markdown cell.

OmranK commented 2 years ago

The only solution found online is insertion via GDrive sharing links as given on this page: https://stackoverflow.com/questions/50670920/how-to-insert-an-inline-image-in-google-colaboratory-from-google-drive

None of those solutions work anymore. I don't understand why a sharable link from Google Drive can't be displayed in markdown but links from other sources can.