I’ve seen a lot of wishes in various comments and feature requests for Lemmy to support image galleries (e.g. similar to Reddit posts with multiple images you can swipe through).

My first thought was to just detect multiple images in the post body and render those (plus the thumbnail) as a gallery instead of just the thumbnail image. That’s absolutely doable, but perhaps there’s a better way?

My second thought, which is what I now prefer, was to make a custom markdown container for an image gallery (the same way the spoiler tag is implemented).

e.g.

:::gallery Gallery Title
![Image 1 Alt Text](https://example.com/image1.jpg "Caption for Image 1")
![Image 2 Alt Text](https://example.com/image2.jpg "Caption for Image 2")
![Image 3 Alt Text](https://example.com/image3.jpg "Caption for Image 3")
:::

It would then render that as an image gallery that can be swiped through.

Pros

  • Easy to implement in most markdown libraries that support custom containers (markdown-it, marked-js, etc)
  • Easy syntax for users
  • Allows explicitly creating a gallery instead of relying on implicit behavior (e.g. detecting / rendering multiple post body images as a gallery)

Cons

  • The custom markdown container would need to be implemented by clients (preferably more than just one or two)
  • It wouldn’t work in Lemmy-UI (hey, they should have to adopt one of our features for a change)
  • The “title” component of the markdown image syntax would be interpreted by some clients as the code for a custom emoji, so that may need to be omitted if we want this to fail mostly-gracefully in less capable apps (cough Lemmy UI cough).

Thoughts? Other suggestions?

  • Admiral Patrick@dubvee.orgOP
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    18 days ago

    Assuming the custom container for galleries doesn’t take off, my backup plan is to use my original idea of detecting multiple images in the post bodies and populating a gallery. To make that behavior explicit, I would probably only trigger that behavior if the post title has a gallery tag/flair (eg. Check out my vaction photos [Gallery]).

    Either way, I’d like to get feedback from other app developers to see if they’d be interested in supporting similar behavior and standardizing it.

  • rglullis@communick.news
    link
    fedilink
    English
    arrow-up
    3
    ·
    18 days ago

    I’m not a “Lemmy App developer”, but I am interested in having more fediverse apps that can rely on ActivityPub directly and less on the server-specific APIs, so I would propose something completely different:

    1. Do not add any type of ad-hoc changes.
    2. Image Galleries can and should be represented as ActivityPub collections. Push the Lemmy devs asking to add a “gallery” collection to the Page object.

    Yeah, I know that this route would be a lot more complicated than pushing for a quick feature. Still, it seems worth doing.

    • Admiral Patrick@dubvee.orgOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      18 days ago

      That’s a valid point, but I’ve come to learn the Lemmy devs are only going to do what they want to do when they want to do it. With the exception of obvious bugs or security issues, I’ve just stopped reporting issues to them; not worth my time.

      This RFC is just about how to present the information returned from the API (activity pub is not involved at this level) and trying to be consistent with other apps in how they do so.

      Example being the spoiler tag. That’s implemented in most clients as a custom markdown container - there’s no ActivityPub model for that, only how the markdown text is rendered.

      Further, if the activity pub collections is added, the rendering for the gallery wouldn’t even need to be changed much, if at all. Essentially, I’m not trying to let perfect be the enemy of good.

      • rglullis@communick.news
        link
        fedilink
        English
        arrow-up
        2
        ·
        18 days ago

        Lemmy devs are only going to do what they want to do when they want to do it.

        I know, I agree, but I don’t really blame them. Either we need to find a way to support them with more resources so that they can increase their output, or we need to take it upon ourselves to make the changes that we would like.

        This RFC is just about how to present the information returned from the API (activity pub is not involved at this level)

        I know and it was clear from the beginning. I am just really tired of dealing with different clients and different accounts to participate in the Fediverse, and I really want to see more clients implementing the C2S side of ActivityPub…