How to link to Google Photos, obtain image’s direct link, and embed Google Photos?

link to google photos
To link to Google Photos is easy, just get an account and upload your photo into Google Photos. However, by default, Google sets this to a private image so you may have to share this first before it can be linked. To share an image, select an image from your gallery. The image will open in a panel, see picture below:

link to google photos 1

On the panel, look to the upper right portion, you’ll see some icons in there. Choose the one encircled red in the picture above. It will open another panel, which will look like the picture below.

getlink google photos

Select “Get link” from the options and it will give you a link to the image. However, note that this is only the link to the Google Photos image, which is in a view mode page. To get the true link, click on the picture on that view page. It will open in the image panel again. This time, right-click on the image to open a pop up menu and select “Copy image address” from the selection.

If you paste the copied link address in a Notepad or in the url address bar of the browser, it would look something like this:

https://lh3.googleusercontent.com/sKqydy4Bu8hx8cLIxI6m7mKwTmvDX1KjHP6ZJk4BtAtaiyME-3b4RiSuMPH0yiVzejwlr0sHD_VmBAuxoF6rCp_mjsUP_p0emkYa9Eb17_7hF56mGpmmYJu0nD366ftlzdVBfRtrM2JZVL2z1vN442qLly4R39aq6lk9PavWSgnwW_p4DvF0JTV82lFPZD1CbqMOIaYPACATtliBhOmGNZPn-5rroJscLtdWHYWPjckJjexKuh2nDEE0DKhTZUSSmuoIAunHf9dU6naZR7M8amuaf2dLTXm2RiVVWeHO9drHgpGWBfZWhmcgY3IAGyPECuX-DzjSbri4PQRPzCuGQQNgJzw2G82N2x0VZTr-U9ZNaj-cfk8LEh7DfAeUwoACUxYKtEa2mCpz8V0MWlTZsUSwjkwEZSyEvHIav9WmN6tO5Z8yuYyhNB2DzUW2jGKUPYSnX3pEAN2CPR0ywzFzBZvvEgN_YLU9g-IcYHu6vL9z9UZraMGBktIVxbBsuQQFcay_WGiRIUTVUCYCznm5dIL1-XJXhKYQSQoZl5jmtbyx8b_f7nQD8RFG-8-kyFxy54UH6Mo_WyM5omk0fJH8phxiY8ruugKdN9YwxQq1f8etCftaQFfp1cPaWCBHeAa1OQyGL4kdxveaycyP6LIXNimSwtlrXOBe=w1567-h731-no

Note of the last part of the url address, it has this value =w1567-h731-no. It means that the image is 1567 pixels Wide x 731 pixels high. The -no indicates that the link is linking to the actual Google Photos image. You can change the values of w and h, and this will open the Google Photos’ Image in the dimension you desire. For example, you set it to w300-h300, Google Photos will convert that Photo into 300px x 300px in dimension.

Now, there is a shortcut to get the link to Google Photos Image, but your image must already be in a shared album. Create a shared album first, or if you already have, move your private images into that album. Once moved, they will be automatically converted to shared pictures. Now, all you have to do is click them then on the image panel where you can share them, instead of sharing them, you can just right click them and copy their image address.

Once you get their shared url link, you can now link to them from anywhere.

Embed Google Photos

picasa to google photos

Since Google retired Picasa in favor of Google Photos, Google’s Photo sharing service became a bit complicated. By the way, Picasa is an image organizer and image viewer app designed for organizing and editing digital photos that comes with an integrated photo-sharing website. It was originally created by a company named Lifescape, and later bought by Google. Back in Picasa’s days, sharing photos was a total cakewalk. Just create albums on Picasa’s web album, upload a photo and get the direct link that you can embed on your website or anywhere. While Google Photos has the same capability, it’s not so very user-friendly, a reason why we find the need to write this tutorial in the first place.

Once you get Google Photos true link (not the view page’s link), you can embed it too. The only problem is that the url is very long and there is really no file extension at the end. However, the url will still work as most browsers would be able to recognize it. To embed, we have the <img src=”[Google Photos Image Link here]” /> in HTML and [url=[Google Photos Image Link here]] in BBCode (providing it supports it) codes to use. Just put the long URL in the source path of those codes and they should come out as embedded images.

While most browsers are able to show Google Photos cloud-based image urls, some blogs and forums, as well as some plugins like for example our Lightbox, are hardcoded to require an extension name in order for the images to show up. Because of this, Google Photos’ urls won’t work because they would be rejected. In order to make it work, we have to get the direct link, but how since Google has encrypted it? Fortunately, there is a way!

Obtain image’s direct link in Google Photos

On February 12, 2016, Google announced it was discontinuing support for Picasa Desktop and Web Albums, and on March 15, 2016, it totally retired the Picasa app in order to focus on their cloud-based Google Photos (being its successor). On May 1, 2016, Picasa Web Albums, a companion service was closed. All links to Picasa were then redirected to Google Photos.

Before, images stored on Picasa Web can be accessed with a simple url and as a file with an extension name. This is still true for files that were uploaded during Picasa’s time, as these images seem to have retain those features and are still working up to this day. But when you upload a new picture on Google Photos, you get a very long url.

Here’s an example:

https://lh3.googleusercontent.com/nmaD6nQZFA881wS8T1hoPPrWalRuHHQQY_2z_xOLpJxJl7ZsB1M4wnQFsNY5k92ELTXuhaiQzNfy4QBpO9YVgEGJ6oXGqS8I8ywq723sMpofVa-rUpH0ddWKxXN3STLWoOSGz2fkwZ49Syi7jIX_IIEwUPHC4tJTS2kYxZqTp1KKnO9vhpWy_l2Io_BgdDvzZa44KwdOHfF6zRQlaX1H6GvrbPvPzqkDuQ2oYsmNpxjmaY8vkm7DMdhPqGotoGC6GSkRvpIoiMLEYHF1miEUdDPGV54psRw5m36l6kzMmGd59DU3azgMexky1h0osiHsjnfFP5gaVWSGfhIHYTMBL-jnT7MDWgkRhmcMBYkXUHqhDyqwPGU9_eQw_u6VddwPcd6AhYkqRShu8vCtKQhiPvfDHzWotcCpc2uCy5q2WWu8FLVlw3xNSlpV0Z27qyzM1vj-Kel5uCZpS1Vai0esJRkNpnTk21jLdOLhO3KlVSSkV0wFNKGXr6DO7jj4aCuecQrNLAa0G_joupEv6U7_f06ErY5vqB4_Zf3YOhIVg4nabGtU6WUS0Slw7fNoCqD34PRS0bl0w3mW0WAB5KYxpPccm1HLfUxwlSIXS-xW15i9p83JH3ZRvlSPVD_-fEclmtWKv4BDoT9SNvZZ3AS99P8QqR-qxRrslzKue_m-qA=w1600-h900-no

As you can see, this is not an actual url that links directly to the file, this is actually a cloud-base url generated by Google that corresponds to the file on their server, and is not the actual file itself. This is problematic when you’re trying to use these images on some forums, and some blogs, as some of them requires you to have an extension and clearly, this one doesn’t have that.

Luckily, while there is no way to directly hotlink to the image file nor there is a way to shorten the link, there is a way to get an extension name. Notice that the urls are actually in a form of a script, and Google allows it to be manipulated by injecting additional codes into it.

Among the tricks we can use are adding ?.jpg or -tmp.jpg at the end of the link.

For example, for the image link above:

https://lh3.googleusercontent.com/nmaD6nQZFA881wS8T1hoPPrWalRuHHQQY_2z_xOLpJxJl7ZsB1M4wnQFsNY5k92ELTX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WWu8FLVlw3xNSlpV0Z27qyzM1vj-Kel5uCZpS1Vai0esJRkNpnTk21jLdOLhO3KlVSSkV0wFNKGXr6DO7jj4aCuecQrNLAa0G_joupEv6U7_f06ErY5vqB4_Zf3YOhIVg4nabGtU6WUS0Slw7fNoCqD34PRS0bl0w3mW0WAB5KYxpPccm1HLfUxwlSIXS-xW15i9p83JH3ZRvlSPVD_-fEclmtWKv4BDoT9SNvZZ3AS99P8QqR-qxRrslzKue_m-qA=w1600-h900-no-tmp.jpg

Notice that in both links wherein we added the ?.jpg and -tmp.jpg to -no at the end of the Google Photos link, our Lightbox is able to open them up. It means that the image link is now treated as a filename.

While both additional url insertions work, it is preferable to add -tmp.jpg than adding ?.jpg due to the fact that ? is a special character and may have some issues with some forums and blogs that discourage their usage in a link.

Size Parameters

As mentioned earlier, Google Photos allows users to manipulate the photos’ sizes by adding a size parameter at the end of the image’s link url, just right before the -no. These resizes the images you are linking. Among the parameters you can add are: “=s400”, “=w400”, “=h400”, “=w800-h400”, etc. wherein the values in those parameters represent the desired size in pixels. =s represents both width and height, =w is for width, =h is for height and =w-h for width and height.

Follow me at:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.