• Resolved knicep

    (@knicep)


    For my website, there are instances where I want to embed single images from my Google Photos library.

    None of the filtering options provided in the Photonic block allow me to select specific photos or from albums or my whole general library.

    The best workaround I have found is to place the photo into its own album and display that album.

    Is there any functionality to skip or index entries in an album?

    Hypothetical:
    Say I have 5 photos in an album and I just want to display the 4th one. Setting parameters count = 1 and skip = 3 would let me just display just the 4th one. Alternatively if there was some way to index it, setting index = 3 or 4 (depends on if you’re 0-indexing) would get you the 4th entry.

    Is the best solution for the time being just to put photos in their own individual album?

Viewing 1 replies (of 1 total)
  • Plugin Author Sayontan Sinha

    (@sayontan)

    The simple reason for this is that no such feature is available in Google Photos’ API.

    The philosophical reason for not having such functionality is that it is an “anti-pattern” that adds four layers of inefficiencies.

    Think of it this way: to include a single photo, all you need to do is to include its URL in your page.

    But if you want to use a plugin, first the block or shortcode has to be rendered (first inefficiency), then your server makes a call to Google to get the media item’s base URL (second inefficiency, which adds a high amount of time to the process), then that is rendered in your markup (third inefficiency), then the base URL is translated by Google on the fly (fourth inefficiency, which adds as much time as the second). Note that Google Photos’ API does not give you the URL, so the fourth inefficiency cannot be avoided. Contrast this to the simple method of directly including the photo’s URL – none of the above four inefficiencies come into the picture.

    Photonic is written to do things that cannot be done easily, so it supports albums etc. Single photos don’t meet this criteria, so such functionality anyway doesn’t meet the cut.

    My suggestion would be to directly use the URL instead of trying to do all of this using a plugin.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.