Images and Thumbnails
The browser sends Accept: image/avif,image/webp,*/*
HTTP header when requesting for images.
The Server handles thumbnail paths in RepositoryDownloadController
. It currently tests if the path starts with THUMB_PATH = "/_thumbs"
and ends with THUMB_EXT = ".jpg"
and then tries to fetch the pre-generated thumbnail directly from storage. It does not try to generate a thumbnail.
webp
support
Updated for In this ticket we extend our RepositoryDownloadController
to check if requested extension is .webp
or .jpg
.
We also need to check if the requested width
and height
are on the list of supported thumb sizes.
If bytes do not exist in storage we trigger the generation of the requested thumbnail (in requested format (webp|jpg
and size), put the bytes in storage (async?) for future use and return the bytes in the HTTP response.
Thumbnail generation aspect
We have an aspect that generates the thumbnails when RepositoryImage
is uploaded. We need an updated ThumbsGenerator
that will generate both webp
and jpg
versions -- and store both copies in bytes storage.