For a (non-determinable period of time) now Hugo stopped resizing images the way it did before. I am pretty sure (as in not 100%) that I did not change the way my images are resized, but suddenly the “focus” of the resized images is on the left instead of the center of the image.
Sample (in grainy screenshots):
used for original
Previously those auto resized images all did center. Pretty sure.
The repo is here to check, but pointing my nose to whatever recently might have changed with that function (currently using 0.95.0) is enough too.
PS: I know that it’s probably just a parameter to add, but I will have to touch lots of projects where I did that, so maybe declaring it as bug might be the lazy (for me) way out.
PPS: The config option in question that I use is this:
resampleFilter = "lanczos"
quality = 70
anchor = "smart"
The anchor smart should have identified the pie/center?
The big question is, did that particular image behave differently before?
We have pretty good test coverage in this are, and I don’t know of any changes re this.
Hmmmm. Hmm Hmm. Another example would be this post where the Hugo logo on a neutral background got cut left-looped too.
But on the other side you all are right… all my older posts look centered.
I cleared cache and redeployed and all old posts still looked the same (centered) and these two are lefted. Very weird. So those sample images might be “misunderstood” by the algorithm. I think I might bite the sour apple and embarass myself and just open an issue in GitHub - muesli/smartcrop: smartcrop finds good image crops for arbitrary crop sizes to see if there is an explanation (too identical colors in case of the pie, i would get that… wouldn’t know what’s breaking the hugo logo) for this.
It’s probably best for my project to just use center as configuration and somehow make it configurable via frontmatter, but the nerd in me wonders why the algorithm thinks of those images as left-sided. Some form of OCD I guess.
You would need to do a very deep dive, probably starting here:
If you want to center, then center.
I don’t. I just think that pie would have been the center of that particular image. And I think that a logo on a continuous color background would have been centered on too. But that is out of the scope of Hugo in any case. It’s one of these “we unleashed AI on the world and now we are wondering why it’s doing what it does” things.
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.