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

Improve conversion of focus points into focal areas #26

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

ababic
Copy link
Collaborator

@ababic ababic commented Apr 25, 2024

The current conversion behaviour is too conservative. When the 1D focus point in Bynder is set close to the centre of the image, the rectangular 'focal area' generated for Wagtail is created by drawing a rectangle around that point that spreads outwards until it can't be any wider or taller.

This isn't really helpful, and actually leads to Wagtail creating some strange crops (as it tries to preserve everything)!

In a bid to improve this on a current project, I came up with this new approach, which instead draws a width-restricted (to 40% of the image) square around the focus point, which produces 'tighter' crops without losing too much of the image.

Copy link
Member

@zerolab zerolab left a comment

Choose a reason for hiding this comment

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

one possible improvement would be to make the % configurable, but 40 is a good enough number :)

@zerolab zerolab merged commit 015512d into main Apr 25, 2024
6 checks passed
@zerolab zerolab deleted the feature/improve-focal-point-conversion branch April 25, 2024 15:16
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.

2 participants