lucid-fox / social-magick

An Open Graph Image generator plugin for Joomla 3 and 4
GNU General Public License v3.0
15 stars 1 forks source link

Extra image crop focus: face #10

Open crystalenka opened 3 years ago

crystalenka commented 3 years ago

There are some instances where it would be beneficial to crop an image based on the location of a face, instead of from the center. (Author profile pages, for example)

The easiest way is probably going to be to allow someone to sign up for a 3rd-party service like Rapid API (https://rapidapi.com/inferdo/api/face-detection6) and only allow it as an option if there's a valid API key.

The linked Face Detection API is free up to 5,000 requests a month - more than enough for most sites.

They offer sample code for cURL requests.

nikosdion commented 3 years ago

Multiple backend

We can have different backends to the face detection code:

Having multiple backends is a bit more flexible, especially if the client is already heavily invested in AWS or Azure. RapidAPI is a good solution for sites which don't already use a public cloud. PHP Facedetect is great for advanced and privacy-conscious users who would rather compile and configure a PHP extension than use a public cloud.

Further notes