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

i137 Fix broken thumbnails pt. 2 #27

Merged
merged 3 commits into from
Aug 18, 2022
Merged

Conversation

bkiahstroud
Copy link
Contributor

@bkiahstroud bkiahstroud commented Aug 16, 2022

Ref https://github.com/harvard-lts/CURIOSity/issues/137

Summary

This line wasn't accounting for all the possible incoming values and thus was only fixing some of the broken thumbnails:

uri.gsub('/full/150,/0/default.jpg', '')

Changes:

  • Generalize string substitution to handle more versions of the incoming thumbnail URIs
  • Specify method name and code comments

@bkiahstroud bkiahstroud requested a review from dl-maura August 16, 2022 23:29
@bkiahstroud bkiahstroud mentioned this pull request Aug 16, 2022
#Append /info.json to end
uri = uri.gsub('/full/150,/0/default.jpg', '')
# Append iiif format (thumbnail version)
uri = uri.gsub(/\/full\/\d*,\d*\/0\/default.jpg/, '')
Copy link
Contributor

Choose a reason for hiding this comment

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

Reading notes: Instead of assuming the thumbnail of 150 this now allows for thumbnails of varied size.

Copy link
Contributor

@dl-maura dl-maura left a comment

Choose a reason for hiding this comment

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

Tested locally!

@dl-maura dl-maura merged commit 02df9b2 into main Aug 18, 2022
@dl-maura dl-maura deleted the i137-broken-thumbnails-pt2 branch August 18, 2022 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants