Google Photos


With effect from version 1.68 of Photonic, Picasa and Google Photos have two different types of shortcodes. The Google Photos module was not available prior to release 1.68 of the plugin. The split has been done to handle the new API Google has previewed for Google Photos in May 2018. Both modules display photos from the same source, but have different strengths and weaknesses. Please see the Picasa page as well.

Using Photonic with simple parameters the gallery short-code can now be used to display albums and photos from Picasa:

The main switch for Picasa is the type parameter. You also need to have a view specified as well:

 [gallery type='google' view='abc'] 

You can also control various skinning aspects of how the thumbnails are displayed.

Google Photos vs. PicasaWeb (🔗)

In its infinite wisdom Google announced the shutdown of its Picasa service in February 2016 in favour of Google Photos. However, until May 2018 the old Picasa API remained the only way to programmatically retrieve photos from Google Photos. As a result Photonic was compelled to use Picasa’s API. Then, in May 2018 Google announced the Google Photos API in “developer preview“, encouraging users to test it, but discouraging use of the same for production instances. The developer preview, while functional, has restrictions in terms of how many requests can be made per day (2500).

In the opinion of many, Google Photos in itself is a giant leap backwards:

  1. PicasaWeb had an easy way of telling you what the album ID was. When Google killed PicasaWeb, this was gone. I have gotten around this by providing a “Helper” for finding the IDs. You can go to Photonic → Helpers → Picasa, put in your user name, and get the IDs. Note that the same album has different IDs between PicasaWeb and Google Photos! Also note that with effect from version 2.00 you will not require the “Helpers” if you use the “Add / Edit Photonic Gallery” button to insert your gallery.
  2. PicasaWeb used to support a mode for “Limited” sharing. As long as it was still around, in PicasaWeb restricted albums created in Google Photos showed up as “Limited”, while the classical PicasaWeb option of “Limited, anyone with the link” also existed for the same album. This permitted you to use the authkey provided by PicasaWeb. But now that PicasaWeb is fully gone, this option doesn’t exist. Google introduces something similar at first glance, wherein it generates a shortcode for an album that you can hand out. E.g. for one of my albums it gives me the link Clicking on the link expands it out, but none of the details in the link help in the API. Moreover the shortcode cannot be expanded by the API without authentication! Try this link. For older albums created with PicasaWeb, the authkey still works, as shown on the Albums page.
  3. In perhaps the least thought out move, Google made it very, very hard to make an album public. In fact, there is no way currently to determine a user’s public albums in Google Photos – you only see the older PicasaWeb albums. There were certain third-party workarounds that let you make albums public, but those do not work any more either.

Which Module to Pick?(🔗)

For most purposes the Picasa module of Photonic does the job perfectly, though the code complexities require jumping through hoops in terms of the shortcode. But there are certain areas where Google Photos do better. You can use the following table for reference:

Use Photonic’s Picasa Module if… Use Photonic’s Google Photos Module if…
  • … You have been using it so far and have had no complaints!
  • … You are using some of the old features of PicasaWeb like unlisted albums.
  • … You have videos and are using a lightbox that does not support videos in Google Photos. Documentation around handling videos in Google Photos is notoriously poor.
  • … The number of daily visitors to your online galleries is in several thousand each day.
  • … You have Shared Albums that simply will not show up in the Picasa module.
  • … You want to use features such as filtering of photos.
  • … You want to avoid making a switch from Picasa to Google at a later stage, because the Picasa API will be retired in the future.
  • … You don’t have immediate concerns around your pages being accessed by more than 2500 visitors each day. In the Developer Preview mode a given API Client ID for Google Photos can only be accessed 2500 times a day.

Both the modules can coexist. As you can see in the demo pages I have got both Picasa and Google running. So you can start using Google Photos and transition slowly from Picasa without breaking anything on your site.

Note that the album ids are different between PicasaWeb and Google Photos for the same album. The shortcode structure is slightly different as well, so you cannot simply swap out type='picasa' with type='google' and expect it to work.

Also note that while Google hasn’t officially announced the date for phasing out the Picasa API, it will be phased out once the Google Photos API is more stable.

Obtaining a Client ID (🔗)

An API key is mandatory for using Google Photos.

You can obtain an API Key using the instructions on the Picasa page. In fact, if you have already obtained this for Picasa, you can reuse it provided the following steps are performed.

Once you have obtained the API key you have to follow these steps to make sure that you are able to use it with Google Photos.

  1. First, make sure that the “Redirect URIs” listed under Photonic → Settings → Google Photos → Google Photos Settings → Google Client ID are present in your API Key settings in Google’s API Console. Instructions are on the Picasa page.
  2. Navigate to the Dashboard of your API Manager and select your API project as per the instructions on the Picasa page. If you don’t have a project, the instructions are again on the Picasa page. You should see something like this:

    Your permitted APIs are listed on this screen

  3. Do you see “Photos Library API” listed in the lower section above? If not, click on the link up top that says “+ ENABLE APIS AND SERVICES”. You should see something like this come up:

    You can search for APIs to add to your account

  4. In the search box above type in “photos”. The “Photos Library API” will now show up. Click on it:

    You can click on the “Photos Library API” for the next steps.

  5. You will be taken to a page with details about the API. Click on the link to enable it:

    Click on the button to “ENABLE” the API

  6. The API will be added and you will be taken to a page with statistics for it. You can go back to the “Dashboard” now:

    The API is added. You can go back to the dashboard.

  7. Your dashboard will show the new API now available. Your Client ID is ready for use!

    All is well!

Authentication (🔗)

Unlike Picasa, Google Photos only supports back-end authentication. To set it up you will need to do the following:

  1. The first step requires you to set the Google Client ID and Google Client Secret at Photonic → Settings → Google Photos → Google Photos Settings. Note that if you have already obtained a Client ID for Picasa previously, you can reuse that, but you have to perform the steps documented in the previous section.
  2. Next, head over to Photonic → Authentication → Google Photos, then start the authentication:

    Click on “Authenticate”

  3. You will be taken to a screen on Google that will ask you to authorize an account. Pick the account associated with your photos:

    Pick the account that has your photos

  4. You will be shown what permissions are requested by your API key. Note that for Picasa authentication only the first one is shown. Google Photos requires the two additional ones. You can allow access to the apps:

    Photonic needs access to your photo library to display information. Click “Allow” to proceed.

  5. You will be taken back to Photonic’s Authentication screen, where you can now obtain the “Refresh Token”:

    The “Authenticate” step is done, and the “Obtain Token” step is now activated.

  6. Clicking on “Obtain Token” will show you the token, which you can now “Save”:

    Clicking “Save Token” will take you to the Settings Page for Google, where the “Refresh Token” is set

With that your authentication is complete. Your setup is now good for use!

Feel free to look at the Photos and Albums pages for examples on usage.