Saturday, February 13, 2016

Google as an Image Server

If you're using a web-app that I created, you'll find that it only accepts URLs of google images. That's because the services I offer are free and I can't afford to host your images, but google will do it for free, and their format has lots of advantages, such as auto-sizing based on URL arguments.

Using google images is easy. Here's how:

If you have a google account, you can upload images. Go to photos.google.com to manage your images. Select the "Photos" icon in the left sidebar, and click the upload button at top right, or just drag and drop images from your computer into the webpage.

The first time you do this, you'll be prompted to choose the upload size. I find that google provides plenty of free space, so I always upload at the original size.

Once your image has uploaded, you can choose to add it to an album.

If this is your first image, you'll have to create a new album.

Once the album is created you can rename it.

While at the album, you can't easily get the image URL because they are displayed as background images.

Click on a thumbnail to view a larger version of the image. In this view you can right-click on the image and select "Copy image address" or "Copy image location" to get its URL.

By default, your album is private, but your images are not.

This album's URL is:
https://photos.google.com/album/AF1QipOQoenjLovd9JFKHhBIPihwa6vUkhUSG2UQzIKG

If you follow that link you'll get "Error 403, Forbidden" because that album isn't public.

This image's URL is:
https://lh3.googleusercontent.com/1Hue0mnN_LsYhSW3Gf7DjfiJP6YitrDsd7Y_Y5Q07NwzxdbsaHpvNx1_o9nT5fAY-DEgONtbW-Jz3uEvq0WrMbDZh1lVSoznslTk_5jEYyci99nW_TIUXsU0fA7xxEQQayr0LryXUbhS99Sa6fMo_qKu9svcOl8oa_4tWd63c-BHudHvb0idK3kgYZvcPYH8oGVtUkojjRHm3W27gsUGzUtNvKgfu6qM3HfgpRraziYKh_gQ2gGLZz_Zu85WLrk80RXHcmmtz6KWzU50xmojc_ANlTVDQ3-aoY_d5EzASNmc9tzFIF33LOrO0S8QwThgmSzFE30HgEnQ4wGpuA6AM0CP2MuitliyCsj-4hCF6vYEw-tWsdPd39bv5opOAEuMg9DbwIMzt95XPSj0d_yG6ZYof2YrS37GgFYZdoNXpl7fyFSV4bXiBO4oBF0BHWQjFaogW8BdBNQsl0zm5rTMhLefZZ_IlqCUtASi1A9S0qko0jdeChNNQXoC3I_KrKb0MgpIMtQ0dGB3BR5KrhQZwDH96OfSORPuiFeg6TQ6SjM6C3Wa1s5BeCFtf0GnDAv1H5cbgA=s572-no

If you follow that link, you'll see the image.

That is the style of URL that my web-apps require.
i.e., https://*.googleusercontent.com/blah.blah.blah

When you later return to photos.google.com, you can select the "Collections" icon in the left sidebar to find that album you created.

web
{ "loggedin": false, "owner": false, "avatar": "", "render": "nothing", "trackingID": "UA-36983794-1", "description": "", "page": { "blogIds": [ 607 ] }, "domain": "holtstrom.com", "base": "\/michael", "url": "https:\/\/holtstrom.com\/michael\/", "frameworkFiles": "https:\/\/holtstrom.com\/michael\/_framework\/_files.4\/", "commonFiles": "https:\/\/holtstrom.com\/michael\/_common\/_files.3\/", "mediaFiles": "https:\/\/holtstrom.com\/michael\/media\/_files.3\/", "tmdbUrl": "http:\/\/www.themoviedb.org\/", "tmdbPoster": "http:\/\/image.tmdb.org\/t\/p\/w342" }