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

Author Image file cropped #526

Closed
mchlebosz opened this issue Apr 6, 2023 · 4 comments · Fixed by #527
Closed

Author Image file cropped #526

mchlebosz opened this issue Apr 6, 2023 · 4 comments · Fixed by #527
Labels
bug Something isn't working

Comments

@mchlebosz
Copy link
Contributor

What happened?

When Using author.image the image seems to be cropped, then rounded. It is not css as the image provided is already cropped.
Everything done accoring to instructions

/assets/ 
| ---- img/  
       | -- problem.jpg  

image = "img/problem.jpg"

Input image:
problem
Page:
image
Element:
image
Hugo shows no errors

Theme version

v2.5.3

Hugo version

v0.111.3+extended windows/amd64

What browsers are you seeing the problem on?

Firefox, Chrome, Microsoft Edge

Relevant Hugo log output

No response

@mchlebosz mchlebosz added the bug Something isn't working label Apr 6, 2023
@mchlebosz
Copy link
Contributor Author

The problem seems to be in Smart Crop in layouts/partials/home/profile.html in header
Line: 8
image
https://gohugo.io/content-management/image-processing/#anchor

It wants to determine crop box on its own, sometimes cropping already perfectly sized images.

I see two solutions here:

  1. You could change the $authorImage.Fill "288x288" to $authorImage.Fit "288x288" to remove the problem, but then when the image is not 1:1 it will be squished
    image

  2. You could change the $authorImage.Fill "288x288" to $authorImage.Fit "288x288 Center" then image will be cropped based on center of image
    image
    In case of 1:1 image it is ok, otherwise we don't really know what crop box location user of theme prefers, so maybe it should be configurable or at least mentioned in docs.
    Here it is center:
    image
    Bottom Left:
    image

The above applies also to layouts/partials/author.html

@mchlebosz
Copy link
Contributor Author

I suggest the second option #527

@github-actions
Copy link

github-actions bot commented May 7, 2023

This issue has been automatically marked as stale because it has not had any recent activity.
If you are still experiencing this issue, please review the issue history and add a reply with any requested and/or additional information in order to keep the issue open.
This issue will automactically close in 14 days if no further activity occurs.

@github-actions github-actions bot added the stale This issue or pull request has not had any recent activity label May 7, 2023
@metbril
Copy link
Contributor

metbril commented May 7, 2023

Keep?

@github-actions github-actions bot removed the stale This issue or pull request has not had any recent activity label May 8, 2023
@jpanther jpanther linked a pull request May 25, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants