Generate Direct Image Link with Google Drive
Procedures
Upload your image into your Google Drive if you don’t already have something there you plan to use. You can also drag and drop your image file into the desired location
Right-click the image and select Share
Set the Permissions and Copy the URL
In the dialog box, select Get Link
Ensure the permissions are set to Anyone with the link can view
Permission level should be Viewer
Click Copy Link, then click Done
Paste this link into notepad or another text editor
Copy the ID from the URL. In this example, the ID that was generated was 1ROFMLHNLdNbmORhLVwv5ecfAswpRokkI
Example: https://drive.google.com/file/d/1ROFMLHNLdNbmORhLVwv5ecfAswpRokkI/view?usp=sharing
Hang onto this for the time being.
The “Base” Code for Direct Image Link from Google
Copy/Paste the following into notepad or other text editor:
|
Create the Custom URL by using elements from each
Swap the *img_id* with your image ID.
The final product from this example would look like this example:
https://drive.google.com/uc?export=view&id=1ROFMLHNLdNbmORhLVwv5ecfAswpRokkI
Use your final product (link) for displaying images directly into a Moodle page.
For example, this image was inserted into a Moodle course page by clicking the Insert an image icon and entering the custom URL.
You can also adjust the size and alignment, as shown in this screenshot.