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

Fixes #408 Set Aspect Ratio and Object Fit #409

Merged
merged 1 commit into from
Sep 8, 2022

Conversation

ChanceM
Copy link
Contributor

@ChanceM ChanceM commented Sep 8, 2022

Creates a custom size class to set image aspect ratio to 1:1 and object fit to cover for non-square images.

Fixes #408

@@ -2,7 +2,7 @@
<a href="/{{ .Type | pluralize }}/{{ .Params.username }}">
<figure class="image is-96x96" style="margin: 0 auto">
<!-- <figure class="image is-96x96 my-0 mx-auto"> -->
<img src="{{ .Params.avatar }}" alt="{{ .Title }}" class="is-rounded" />
<img src="{{ .Params.avatar }}" alt="{{ .Title }}" class="custom__set-1by1 is-rounded" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would the Bulma is-square or is-1by1 work for this? Or is the object-fit: cover not included in that?
https://bulma.io/documentation/elements/image/#responsive-images-with-ratios

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately no, I did try those first.

Copy link
Contributor Author

@ChanceM ChanceM Sep 8, 2022

Choose a reason for hiding this comment

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

custom__set-1by1
image

is-square
image

is-1by1
image

Copy link
Collaborator

Choose a reason for hiding this comment

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

nice trial&error ; )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

More like attempt to use the "supported" styles/classes before adding custom parts.

Copy link
Collaborator

@gerbrent gerbrent Sep 8, 2022

Choose a reason for hiding this comment

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

that gets me thinking then: should we use the "supported" methods differently to create all of the thumbnails?

As in: is this a band-aid, or should we be revisiting how the thumbnails get generated more generally to cover these edge cases? Is there a better way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will provide greater coverage should an image not meet a 1:1 aspect ratio. I'm not exactly sure where they are pulled from or if JB can exert full control over them.

Copy link
Collaborator

@gerbrent gerbrent Sep 8, 2022

Choose a reason for hiding this comment

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

most of the images were scraped by the scraper from Fireside. The images thus were necessarily previously ingested by Fireside's process and likely made to conform to a specific standard.

Alex' photo is the first to be replaced independent of Fireside - he applied it here as a PR - and thus is the first case of integrating non-standard photos into our site here.

THAT is the difference, and why all a sudden Alex' photo is problematic.

Likely we will need to test a variety of images to see how Hugo & company manage their integration seamlessly.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Kind of tangentially related, talked about images sizing here a bit: #326 (comment)

@ChanceM ChanceM changed the title Fixes #408 Set Aspect Ration and Object Fit Fixes #408 Set Aspect Ratio and Object Fit Sep 8, 2022
Copy link
Collaborator

@gerbrent gerbrent 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 and all looks good here.

@gerbrent
Copy link
Collaborator

gerbrent commented Sep 8, 2022

@ChanceM thanks for jumping in on this one so quickly!

@gerbrent
Copy link
Collaborator

gerbrent commented Sep 8, 2022

@CGBassPlayer when you're satisfied say that word and I'll happily merge this

Copy link
Collaborator

@CGBassPlayer CGBassPlayer left a comment

Choose a reason for hiding this comment

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

Looks good to me

@gerbrent gerbrent merged commit b910ff5 into JupiterBroadcasting:main Sep 8, 2022
@ChanceM ChanceM deleted the bug/fix-show-host-image branch September 8, 2022 22:04
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.

people thumbnail - misaligned on Show pages
4 participants