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

TIFF thumbnails do not work #2442

Open
obulat opened this issue Jun 19, 2023 · 3 comments
Open

TIFF thumbnails do not work #2442

obulat opened this issue Jun 19, 2023 · 3 comments
Labels
🕹 aspect: interface Concerns end-users' experience with the software ✨ goal: improvement Improvement to an existing user-facing feature 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: api Related to the Django API

Comments

@obulat
Copy link
Contributor

obulat commented Jun 19, 2023

Problem

Currently TIFF thumbnails do not work as they're not supported by our thumbnail service provider Photon. This feels like poor service to our users because TIFF files are usually large, and are sometimes not supported by the browser.

Description

On the frontend we fallback to the full direct image url when a thumbnail isn't available.

We should create a separate service for TIFF thumbnails.

Additionally, on any search with the extension=tiff (or extension=tif, which returns a different set of images) query param set, all thumbnails will fail with 415 errors.

Alternatives

Currently < 2% of our thumbnails are 415 Unsupported Media type errors, so this does not impact many thumbnails and therefore, users.
We could investigate the TIFF files that we have and try to ingest the thumbnails for them from the providers. Those could be sent to photon.

Additional context

This is an issue discovered after the SVG thumbnails in #2397

@obulat obulat added 🟧 priority: high Stalls work on the project or its dependents ✨ goal: improvement Improvement to an existing user-facing feature 🕹 aspect: interface Concerns end-users' experience with the software 🧱 stack: api Related to the Django API labels Jun 19, 2023
@zackkrida zackkrida added 🟨 priority: medium Not blocking but should be addressed soon and removed 🟧 priority: high Stalls work on the project or its dependents labels Jun 27, 2023
@zackkrida
Copy link
Member

Reducing priority to medium due to the limited number of requests and users this impacts.

@sarayourfriend
Copy link
Contributor

We can solve this for Wikimedia by using Wikimedia's thumbnails.

For any URL, you can derive the thumbnail:

For this file: https://upload.wikimedia.org/wikipedia/commons/c/c5/Fryanovo_2023-08_1691863768.tif

The thumbnail at 600px is: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Fryanovo_2023-08_1691863768.tif/lossy-600px-Fryanovo_2023-08_1691863768.tif.jpg

Which is derived by adding /thumb to the path after /commons, then /lossy-<dimensions>px-<filename with extension>.jpg at the end.

This appears to work for any Wikimedia result, actually.

We can probably backfill these into the catalogue data with a batched update (cc @stacimc), or we can trial it in the API as a temporary addition to the image proxy route when a Wikimedia tiff is requested. We can use the derived URL to send upstream to Site Accelerator or we can use the derived URL directly.

@sarayourfriend
Copy link
Contributor

@krysal you've done a lot of querying the database recently. Did you happen to notice whether we have tiff records for any providers other than Wikimedia? If we only ingest tiff from Wikimedia, then the main problem in this specific issue is covered by #4736. We would need to revisit this if we ingested tiffs from other providers (we'd probably need to start running imgproxy or something else that uses libvips and supports wider formats, which we could put upstream of Site Accelerator, similar to how #4736 handles Wikimedia's thumbnail service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕹 aspect: interface Concerns end-users' experience with the software ✨ goal: improvement Improvement to an existing user-facing feature 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: api Related to the Django API
Projects
Status: 📋 Backlog
Development

No branches or pull requests

3 participants