Skip to content

update thumbnail, allow user to choose output format#3714

Open
kouz75 wants to merge 5 commits intobolt:6.1from
shirkalab:thumbnail
Open

update thumbnail, allow user to choose output format#3714
kouz75 wants to merge 5 commits intobolt:6.1from
shirkalab:thumbnail

Conversation

@kouz75
Copy link
Copy Markdown
Contributor

@kouz75 kouz75 commented Apr 28, 2026

Add output format support to thumbnail URLs

  • Add optional format parameter to ThumbnailHelper, ImageExtension, and the thumbnail() Twig function
  • Encode the output format as a filename suffix in the URL (e.g. image.jpg.avif) instead of in the param string
  • Parse the format suffix in ImageController to set Glide's fm parameter and resolve the correct source file
  • Backward compatible: URLs without a format suffix continue to work unchanged

Update thumbnail file path in Twig and filesystem to match image URL structure, allowing Apache/Nginx to serve them directly without any PHP call

@kouz75 kouz75 marked this pull request as ready for review April 28, 2026 09:43
@kouz75 kouz75 marked this pull request as draft April 30, 2026 14:42
@kouz75 kouz75 marked this pull request as ready for review April 30, 2026 14:58
@Vondry
Copy link
Copy Markdown
Contributor

Vondry commented May 4, 2026

As a general question - is there a command that would "warm up" thumbnail cache so that even first user can benefit from fast loading image?

@kouz75
Copy link
Copy Markdown
Contributor Author

kouz75 commented May 4, 2026

There is no command for that yet.
One way to fix this is to add a new command that parses all media files (or the content) and generates their thumbnails. The thumbnail settings can be defined in theme.yaml or passed as parameters to the command.

This command may generate a lot of thumbnails that will never be displayed on the website.

kouz75 added 3 commits May 4, 2026 22:44
… structure, allowing Apache/Nginx to serve them directly without any PHP call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants