Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Use smaller image for generating thumbnails for SMK #895

Closed
1 task
stacimc opened this issue Aug 24, 2022 · 4 comments · Fixed by #938
Closed
1 task

Use smaller image for generating thumbnails for SMK #895

stacimc opened this issue Aug 24, 2022 · 4 comments · Fixed by #938
Assignees
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟧 priority: high Stalls work on the project or its dependents

Comments

@stacimc
Copy link
Contributor

stacimc commented Aug 24, 2022

Description

Images linked in the image_urls for the SMK provider are all ~2MB. These are large enough to overload our thumbnail service. Some of these requests timeout, such that the frontend falls back to downloading the entire full image. The result is unacceptable load times.

We should update the API to detect the SMK provider and modify the URL used for thumbnail generation.

image_url that we receive has the form: https://iip.smk.dk/iiif/jp2/KKSgb5100_34.TIF.jp2/full/!2048,/0/default.jpg Note the2048.

The modified URL should be identical, except for a reduced filesize: https://iip.smk.dk/iiif/jp2/KKSgb5100_34.TIF.jp2/full/!400,/0/default.jpg

Additional context

This change should be a temporary quick-fix that will allow us to re-enable the SMK provider, so we can make these images available again as soon as possible.

In the longer term, https://github.com/WordPress/openverse-catalog/issues/698 tracks updating the provider to provide links to smaller files for the purpose of thumbnail generation.

Resolution

  • 🙋 I would be interested in resolving this bug.
@stacimc stacimc added 🟧 priority: high Stalls work on the project or its dependents 🛠 goal: fix Bug fix 💻 aspect: code Concerns the software code in the repository labels Aug 24, 2022
@zackkrida
Copy link
Member

SMK confirmed that the smaller the image, the faster the endpoint is. So we could use the https://iip.smk.dk/iiif/jp2/KKSgb5100_34.TIF.jp2/full/!512,/0/default.jpg 512px size for our thumbnails.

@Hussain0520
Copy link

Hey @zackkrida is this issue still open? I would like to contribute to this issue.

@zackkrida
Copy link
Member

@Hussain0520 that would be fantastic. Yes, this issue is still open. This would essentially be a 'hotfix' to our API /thumbs endpoint that checks when the provider is smk and rewrites the image url to use the 512 width instead of the 2048.

I assume we want to do this work here:

def thumbnail(self, request, *_, **__):
but @stacimc or @krysal can confirm.

Please visit our #openverse channel in the Make WP slack if you need any real-time help, otherwise you can leave thoughts here or on your PR. Thank you!

@dhruvkb
Copy link
Member

dhruvkb commented Sep 21, 2022

@Hussain0520 are you working on this ticket? This is a high priority ticket so we would appreciate if you could let us know if you would not be able to work on that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟧 priority: high Stalls work on the project or its dependents
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants