funkhaus / funkhaus-auto-seo

Automatically implement SEO best practices using the power of AI
11 stars 7 forks source link

Focal points seem to be wrong #2

Closed drewbaker closed 3 years ago

drewbaker commented 3 years ago

The focal point of an image seems to be wrong, often off screen.

drewbaker commented 3 years ago

Focal points are calculated here: https://github.com/funkhaus/funkhaus-auto-seo/blob/main/includes/focal-point.php

The idea is that Azure returns a focal-area, and we want to get the center of that area as a percentage of the overall image.

For example, the focal point would be saved as x: 50%, y: 50% if the very center of the image is the focal point. It would be y: 0%, x: 100% if the top left croner was the focal point (very unlikely example BTW).