Introduce Thumbnails for files #51

Closed
opened 2024-03-05 12:33:52 +01:00 by Pablo Vazquez · 4 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). * [x] ~~implement thumbnailing as in other projects (using `sorl.thumbnail`?)~~ * [x] Use thumbnails in cards * [x] ~~Use thumbnails in small versions of previews in Extension Detail~~ #100 * [x] Bug: videos are not working on the gallery since the introduction of thumbnails. * [x] 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
Owner

Changed thumbnails format to WebP 6f07ae61b6

Changed thumbnails format to WebP https://projects.blender.org/infrastructure/extensions-website/commit/6f07ae61b6c09a60f8f1ff6b9f25fbe94a20a7be
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.