Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provider thumbnails #5631

Open
2 of 6 tasks
mifi opened this issue Jan 30, 2025 · 1 comment
Open
2 of 6 tasks

Provider thumbnails #5631

mifi opened this issue Jan 30, 2025 · 1 comment
Labels

Comments

@mifi
Copy link
Contributor

mifi commented Jan 30, 2025

Many providers are missing thumbnails. When users upload images (which is quite common), this makes the UX not very good.

There are two different kind of thumbnails that could be shown:

Browsing files

When selecting files in the native Google picker UI:

Selected files

After having selected files, in the Uppy UI:

Proxying

One problem with proxied thumbnails is that it would involve a lot of requests to the Companion server. This could be mitigated with one of either:

  • Make sure that we only fetch thumbnails for the images that are currently in-view in the HTML. When scrolling fast we probably need a debouncing/throttling
  • Use batch endpoints where available, still need to render only those currently in-view and debouncing/throttling when scrolling
  • If we simply proxy the full images, it would lead to high bandwidth usage for the client (e.g. if the user is trying to view thumbnails for 10MB images), which is unacceptable, so we need to either
    • specify a size parameter to the URL before proxying it (not all providers support this)
    • compress it in companion using e.g. sharp (cpu intensive and could be a security risk).

See also #5389

Alternatives

Make a Transloadit-backed integration for rendering thumbnails

@Murderlon
Copy link
Member

  • Make sure that we only fetch thumbnails for the images that are currently in-view in the HTML. When scrolling fast we probably need a debouncing/throttling

We already use loading="lazy" on <img> tags so we already have this without any additional complexity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants