feat(Assets): Generate & Use thumbnails for assets #1524
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When browsing assets in the asset manager, the full images are used as that's the only data we currently have.
This can become quite heavy if a lot of images are shown.
This PR adds support for thumbnails which are 200x200 in size. They are generated in webp and jpeg formats and are stored in the new special
thumbnails
folder in the assets directory. (default isserver/static/assets/
)The first server boot after this change will start a background task to generate thumbnails for all existing assets. This might spit out some errors for some assets that could not be converted for some reason. For those assets the full image will be used as a fallback when showing assets. The main reasons for this to fail is that either the image on disk no longer exists or that the image is too big.