Opinions on `images`?

Esteemed reader,

we began to work on the “Image and “Images” widgets today.

In the end they will support all the nice preloading techniques and aspect ratios etc.
Images can be slideshow like, masonry or fixed aspect ratio.
To begin, as a proof of concept we implemented a masonry layout.
Thanks to awesome CSS people feature requests for a native masonry landed in the final draft and this can be enabled already in FF
“about:config” and toggle “layout.css.grid-template-masonry-value.enabled” …
So, we will base it on this but wrote a JS fallback for grid (see commit) …
The masonry will have pagination with up to 8 images per active.


However,
back to ActivityPub, my UI assumption is:
Treat images in the property image different from attachment images.
The first should be “prominent” and maintain aspect ratio and show all images (not only e.g. 4) and the second can be fixed and smaller.

  • What would be your favourite layout for the image property?

  • Should it be different per Object type?
    e.g. it could be a slideshow while playing Audio and gallery for an Article and masonry for others

This would be a <picture srcset> but we do not know how widely this would be supported.

See also example 51 in the Spec.

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Image",
  "name": "Cat Jumping on Wagon",
  "url": [
    {
      "type": "Link",
      "href": "http://example.org/image.jpeg",
      "mediaType": "image/jpeg",
      "width": 400
    },
    {
      "type": "Link",
      "href": "http://example.org/image.png",
      "mediaType": "image/jpeg",
      "width": 1920
    }
  ]
}

Sorry people,
missed this

Many implementations download the images server-side and serve them from there instead of hotlinking. I download and store them as webp when they’re first accessed and put them through that imgproxy thing (btw need to update it and start using avif) behind nginx cache to get different sizes and formats as needed.

This would be neat for C2S though.