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

[Jupiter] Bad proportions for thumbnail css in search results #661

Closed
pbinkley opened this issue Apr 10, 2018 · 8 comments
Closed

[Jupiter] Bad proportions for thumbnail css in search results #661

pbinkley opened this issue Apr 10, 2018 · 8 comments
Assignees
Labels

Comments

@pbinkley
Copy link
Member

Landscape-mode thumbnail are displayed with their true proportions, but portrait-mode ones are squashed to a square. Presumably we want them to appear in their true proportions.

Thumbnail:
p1020101-20--20copy jpg

Screenshot of search results:
thumbnailsinsearchresults

@pbinkley pbinkley added the bug label Apr 10, 2018
@pbinkley
Copy link
Member Author

This problem exists in the main item page as well as in search results.

@weiweishi
Copy link
Contributor

Confirmed with @leahvanderjagt and @abombak that the views (both search and item view) should:

  • recognize the orientation of the thumbnail image and present accordingly in landscape/portrait mode
  • critical to have thumbnails for reports/documents are presented properly with their letter-size proportion (350x270 or 4x3)
    image
  • landscape thumbnails should be presented as is.
  • for cases that the images are out of proportion, can crop/trim the image to fit into the maximum length/width allowed.

@pbinkley
Copy link
Member Author

So "out of proportion" is defined as having the short dimension < 270 when the long dimension is converted to 350? And cropping should be centered?

@weiweishi
Copy link
Contributor

weiweishi commented Oct 16, 2018

it would be more like

  • long dimension would be a maximum of 350 (or on the view pages, a fragment of 350, such as 175px)
  • if the short dimension exceeds 270, (or relative to the long dimension, such as 135 px), trim/crop the short dimension to fit 135 px.

The maximum dimension of the thumbnail would be 175x135 instead of a square of 150x150. I hope this makes sense?

@weiweishi weiweishi changed the title Bad proportions for thumbnail css in search results [Discovery] Bad proportions for thumbnail css in search results Oct 17, 2018
@weiweishi weiweishi changed the title [Discovery] Bad proportions for thumbnail css in search results [Jupiter] Bad proportions for thumbnail css in search results Oct 17, 2018
@weiweishi
Copy link
Contributor

Update this file: https://github.com/ualbertalib/jupiter/blob/master/app/assets/stylesheets/image.scss#L2-L3
with 175x135 or 4x3 dimensions.

@pgwillia
Copy link
Member

I found an alternate solution. https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit
The results look like this:
screenshot from 2018-11-28 15-09-32
screenshot from 2018-11-28 15-09-24
screenshot from 2018-11-28 15-09-16
Is this acceptable?

@murny
Copy link
Contributor

murny commented Nov 28, 2018

Might have to be careful with this approach?
https://caniuse.com/#feat=object-fit

Looks like this doesn't work on IE11 and Some Edge (<15) versions 😢 .

Which might be a fair amount of users? (From looking at google analytics it looks like since jupiter launched we get about 5.8% of users using IE and 3.8% using Edge (good news is 75% of edge users are on the higher supported versions), so that's almost 8% of our user base?)

@pgwillia
Copy link
Member

Thanks for that. Used the solution provided.

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

Successfully merging a pull request may close this issue.

4 participants