Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Experimental project
This is a sandbox project, which contains experimental code for developer use only.
This module/sandbox was created as a proof-of-concept for using the Face.com API for smart image cropping. The idea originates in #910142: Implement face-detection and the SmartCrop module.
This project includes 2 modules:
- FaceAPI is a wrapper for the Face.com PHP Client (which itself is a wrapper for the REST webservice)
- FaceCrop provides an image cache action "Face Crop", which tries to detect faces in a picture and then uses the first detected face as the center for the crop.
How to use:
- Enable both modules
- Signup for API keys @face.com and enter them on the FaceAPI settings page
- Add a "Face Crop" action to one of your image presets
Notes/Problems:
- FaceAPI: the face.com client seems to only work with publicly available URLs at the moment (i.e. it won't work on a local development platform)
- FaceAPI: Face.com has a hard time handling large files... (the recommended size on their website is up to 800px and the service seems to be unable to handle files larger than 2MB)
- Face Crop: Multiple faces are recognised, but only the "first detected" is used
- Face Crop: If no face is detected, it falls back to standard crop
If you are a developer you can play around with the Face.com API by calling faceapi_api($method, $args = array())
. (Method names and arguments have to exist in the FaceRestClient interface)
Project information
- No further development
No longer developed by its maintainers. - Created by bforchhammer on , updated