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

Reinstate image thumbnail column #903

Merged
merged 6 commits into from
Dec 7, 2022
Merged

Reinstate image thumbnail column #903

merged 6 commits into from
Dec 7, 2022

Conversation

krysal
Copy link
Member

@krysal krysal commented Dec 1, 2022

Fixes

Fixes WordPress/openverse#1359 by @AetherUnbound
Fixes WordPress/openverse#1450 by @stacimc

Description

This PR reverts the hard-coding None assignment to thumbnail_url for images to allow provider scripts to set this column. Also, it completes the SMK script with thumbnails as this is the provider that originated the use case, and for ease of testing.

This PR enables removing the hotfix to the API applied in WordPress/openverse-api#938 once these images are refreshed.

Testing Instructions

You can try triggering the smk_workflow and when it finishes see the image table has the thumbnail column filled. Recommended to use an AIRFLOW_VAR_INGESTION_LIMIT (e.g. to 100) for quick testing.

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@krysal krysal 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 Dec 1, 2022
@krysal krysal requested a review from a team as a code owner December 1, 2022 23:15
Copy link
Contributor

@stacimc stacimc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I tested this locally and opened a few image urls/ thumbnail urls, definitely a significant difference in loading speed. Just one note about legacy non IIF-enabled images.

The thumbnails look great to me, but out of curiosity was there a particular reason for going with 600px? Historically I think we used 400.

@krysal
Copy link
Member Author

krysal commented Dec 5, 2022

was there a particular reason for going with 600px?

It's the default width the API is using for thumbnails:
https://github.com/WordPress/openverse-api/blob/d1b685ae77b1cfebc71b229a46a0374a496b83bb/api/catalog/settings.py#L208

I changed the approach to just storing the thumbnail link provided by SMK, these are probably cached so it shouldn't take much time to load. Thumbnails of 600px width still load a little faster but the ones with 1024px look better. This makes the script simpler. Thanks for the suggestion! :)

@krysal krysal requested review from stacimc and obulat December 5, 2022 16:50
Copy link
Contributor

@stacimc stacimc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looks great! We'll probably want to keep an eye on it to make sure the new 1024 thumbnail size load times are okay since it's a bit bigger than what we've used in the past, but it looks fine to me.

Copy link
Member

@zackkrida zackkrida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. LGTM! And thank you; the 1024 images do look dramatically better in the frontend. Even if initial loads are a bit slower, it's a dramatic improvement. These thumbnails are being rendered at 400px wide on a retina display and the difference is remarkable:

CleanShot 2022-12-07 at 16 17 22

@krysal krysal merged commit f3799fc into main Dec 7, 2022
@krysal krysal deleted the thumbnail_col branch December 7, 2022 21:30
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 this pull request may close these issues.

Set separate 'thumbnail_url' for SMK Reinstate image thumbnail column
3 participants