Show an Image from Google Drive in your AI2 app

This method is now DEPRECATED / NO LONGER WORKS due to changes made by Google.

Currently, the future recommended alternative is to host your images somewhere other than google drive!


You could try this url instead (working as at August 2024):

https://lh3.googleusercontent.com/d/FILE_ID

e.g.

https://lh3.googleusercontent.com/d/10Td0e7m2j6xWe29tAFAdx_bzEdmD1E8F

(Apparently you can use lh2 through to lh6 as well)


If you want a thumbnail image, or an image at a specific size you can add, for example `=w100-h100`

e.g.

https://lh3.googleusercontent.com/d/10Td0e7m2j6xWe29tAFAdx_bzEdmD1E8F=w100-h100

which will return a 100x100 image. You can just use "w" or "h" on their own, aspect ratio should be maintained


Google Drive doesn’t directly provide a properly linked url to a file stored there, you have to edit the shared url yourself in order for the file to display, or download for outside of google drive.

https://drive.google.com/file/d/10Td0e7m2j6xWe29tAFAdx_bzEdmD1E8F/view?usp=drive_link


https://drive.google.com/uc?export=download&id=1_NPfCfgpq75RWAyKl8asKQU3hcnjUu4e

This may also work with just uc?id=

https://drive.google.com/uc?id=1_NPfCfgpq75RWAyKl8asKQU3hcnjUu4e