PSA: Embedding Google Drive images

Be sure to read and follow the guidelines for our forums.

Mar 22, 2024 6:07 pm
I've spent a good hour trying to figure out why my images hosted on Google Drive stopped working with the image tag, so here is the solution in case anyone else ever has the same issue.

Apparently Google Drive changed its policies and with them the way links to files work. The new format for a direct link is this:
Quote:
https://drive.google.com/thumbnail?id=(image id)&sz=w(pixels)
So an image with this share link:
https://drive.google.com/file/d/1PH-pgd2qCyiEv9cr1iVVDDnx6W0hmZSB/view?usp=sharing
becomes
https://drive.google.com/thumbnail?id=1PH-pgd2qCyiEv9cr1iVVDDnx6W0hmZSB&sz=w100
and results in
https://drive.google.com/thumbnail?id=1PH-pgd2qCyiEv9cr1iVVDDnx6W0hmZSB&sz=w100
Credit to this article, it saved me the pain of guessing the new format. :'D
Mar 22, 2024 7:09 pm
So...does modifying the "&sz=w#" tag allow you to control the size (pixel width) of the image?
Mar 22, 2024 7:30 pm
It does. You also don't need the size tag. As long as you truncate the link after the ID and add the ampersand, it'll pick up.

https://drive.google.com/thumbnail?id=1PH-pgd2qCyiEv9cr1iVVDDnx6W0hmZSB&

I didn't remember this would be happening at all, so thank you @flyingsucculent.
Last edited March 22, 2024 7:31 pm
Mar 23, 2024 3:39 am
https://drive.google.com/thumbnail?id=1i8L7cvt-dRjLKureAik03XM0O0tlzac0&
Neat !

Size change up: 300px
https://drive.google.com/thumbnail?id=1i8L7cvt-dRjLKureAik03XM0O0tlzac0&sz=w300

Size change down: 40px
https://drive.google.com/thumbnail?id=1i8L7cvt-dRjLKureAik03XM0O0tlzac0&sz=w40

I've been using the Imgur upload button for images but I might just switch to Google Drive for this kind of functionality.
Thanks for the tip, FS!

The only downside is having to manually reformat the image url, I guess.
Mar 23, 2024 5:19 am
Hm, I don't see your images, witchdoctor
Mar 23, 2024 5:53 am
Doc needs to set the permissions in Drive appropriately...
Mar 23, 2024 2:37 pm
Harrigan says:
Doc needs to set the permissions in Drive appropriately...
👍

Computers are difficult. Thanks for the heads up!
Last edited March 23, 2024 2:38 pm
Mar 23, 2024 3:35 pm
We need to find this feature for Imgur!
Mar 23, 2024 4:47 pm
Harrigan says:
We need to find this feature for Imgur!
Which feature? Posting different sizes? Imgur can do that.

I took the biggest one from above and uploaded to imgur via GP:

Full size:

[img]https://i.imgur.com/MbYqzDq.png[/img]

https://i.imgur.com/MbYqzDq.png
For a huge (1024×1024) version, add a 'h' before .png:

[img]https://i.imgur.com/MbYqzDqh.png[/img]

https://i.imgur.com/MbYqzDqh.png
For a large (640×640) version, add a 'l' (L) before .png:

[img]https://i.imgur.com/MbYqzDql.png[/img]

https://i.imgur.com/MbYqzDql.png
For a medium (320×320) version, add a 'm' before .png:

[img]https://i.imgur.com/MbYqzDqm.png[/img]

https://i.imgur.com/MbYqzDqm.png
For a tiny (160×160) version, add a 't' before .png:

[img]https://i.imgur.com/MbYqzDqt.png[/img]

https://i.imgur.com/MbYqzDqt.png
An 's' gives you a square, cropped 'thumbnail'.

[img]https://i.imgur.com/MbYqzDqs.png[/img]

https://i.imgur.com/MbYqzDqs.png
There are other options that I don't remember.
Mar 23, 2024 7:53 pm
So why doesn't GP follow BBCode for images in general?

[img=50]url.gif[/img] should give me an image 50 pixels wide, but instead I just get this same text back.
Mar 23, 2024 10:38 pm
Didn't know that, Vague -- thanks a bunch, have been longing for a quick way to re-size!

You do not have permission to post in this thread.