Skip to content

Add images.Overlay filter #8057

@onedrawingperday

Description

@onedrawingperday

A while back I opened this topic in the forum.

This is a missing feature that causes me grief again and again.
So I decided to post in the GitHub issues tracker hoping that perhaps someone someday might look into it.

Use case: Square product thumbnails need to be generated from portrait product photos.

Current situation: If one uses for example {{- $thumb := ($original.Resize "1080x1080").RelPermalink }} they will end up with a distorted image since .Resize does exactly as told without any concept of respecting the aspect ratio. Similarly if one were to use {{- $thumb := ($original.Fit "1080x1080").RelPermalink }} they would end up with an image that respects the original aspect ratio but is not square.

I have sort of forgotten As far as I can tell the library that Hugo uses for image processing is https://github.com/disintegration/imaging/ if you think that this issue does not belong here, let me know and I will open an issue upstream.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions