Introduce Thumbnails for files #51

Open
opened 2024-03-05 12:33:52 +01:00 by Pablo Vazquez · 3 comments

At the moment images are always loaded in full size, making the site slow (right now the homepage has images of up to 2MB).

  • implement thumbnailing as in other projects (using sorl.thumbnail?)
  • Use thumbnails in cards
  • Use thumbnails in small versions of previews in Extension Detail #100
  • Bug: videos are not working on the gallery since the introduction of thumbnails.
  • Use thumbnails in Extension Update template
At the moment images are always loaded in full size, making the site slow (right now the homepage has images of up to 2MB). * [ ] ~~implement thumbnailing as in other projects (using `sorl.thumbnail`?)~~ * [x] Use thumbnails in cards * [ ] ~~Use thumbnails in small versions of previews in Extension Detail~~ #100 * [ ] Bug: videos are not working on the gallery since the introduction of thumbnails. * [ ] Use thumbnails in Extension Update template
Pablo Vazquez added the
Type
Enhancement
Priority
Normal
labels 2024-03-05 12:33:52 +01:00
Anna Sirota self-assigned this 2024-04-02 15:33:51 +02:00
Owner

Deployed thumbnails generation for images and videos both in staging and production.

About sorl: it's not used because we've had problems with its caching causing very high database I/O in Blender ID (so high it was discovered because it caused regular performance drops for other services) , even though Blender ID barely uses any images.
So, out of caution, I'd not use it in a new project that can be expected to have quite some traffic.

Thumbnails get generated in background tasks, and if no thumbnails exist, source image will be used instead (Sentry will log errors about this).

An annoying side-effect of this is that in development, ./manage.py process_tasks has to be run in order for thumbnails to be generated (same as with ClamAV scanning).

See more details in #87

Deployed thumbnails generation for images and videos both in staging and production. About `sorl`: it's not used because we've had problems with its caching causing very high database I/O in Blender ID (so high it was discovered because it caused regular performance drops for other services) , even though Blender ID barely uses any images. So, out of caution, I'd not use it in a new project that can be expected to have quite some traffic. Thumbnails get generated in background tasks, and if no thumbnails exist, source image will be used instead (Sentry will log errors about this). An annoying side-effect of this is that in development, `./manage.py process_tasks` has to be run in order for thumbnails to be generated (same as with `ClamAV` scanning). See more details in https://projects.blender.org/infrastructure/extensions-website/pulls/87
Author
Owner

Great! Any reason to go with PNG instead of something like WebP? Or even jpeg.

Great! Any reason to go with PNG instead of something like [WebP](https://developers.google.com/speed/webp#:~:text=WebP%20lossless%20images%20are%2026,of%20just%2022%25%20additional%20bytes.)? Or even jpeg.
Owner

Not JPEG because I'd expect a lot of text on extensions previews, and JPEG compression doesn't handle text well.
As for WebP I forgot about it again tbh: is it good at compressing illustrations with text and other sharp-edged graphics on them, compared to PNG?
It's easy to change, if WebP is preferable

Not `JPEG` because I'd expect a lot of text on extensions previews, and `JPEG` compression doesn't handle text well. As for `WebP` I forgot about it again tbh: is it good at compressing illustrations with text and other sharp-edged graphics on them, compared to `PNG`? It's easy to change, if `WebP` is preferable
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: infrastructure/extensions-website#51
No description provided.