mauricesvay/php-facedetection
Pure-PHP face detection library for images. Scans photos for frontal faces and returns bounding-box coordinates, with no OpenCV or external binaries required. Useful for cropping avatars, tagging photos, or adding basic image analysis to Laravel/PHP apps.
cropFaceToJpeg, which collapses the previous "detect then crop yourself" two-step into a single call and makes the package marginally more self-contained. That convenience does not change the fundamental constraint: pure-PHP Haar cascade scanning is CPU-bound and unsuitable for real-time, high-resolution, or high-throughput face detection. Keep it behind a service interface, not called directly from controllers or models.cropFaceToJpeg expose configurable padding, minimum face size, quality, and output format — and if not, is its fixed framing acceptable for our UI? Are bounding boxes plus a crop sufficient, or are landmarks/confidence scores required?FaceDetector interface with a PhpFaceDetectionAdapter. Use Laravel queues for detection and crop jobs, Storage for original/derived assets, and validation for MIME/size/dimensions. With 0.1.0, the adapter can delegate straightforward cropping to cropFaceToJpeg for simple avatar cases, while retaining our own GD/Intervention Image path for padding, square framing, transparency, or non-JPEG outputs. Keep sensitivity, scaling, and crop framing configuration outside application code.memory_limit, max_execution_time, and queue worker limits, and test corrupt, large, and zero-face images through the new crop path. Treat PHP 8 deprecations and fatal errors as likely fork work. Pin to a reviewed commit and record the provenance of 0.1.0.cropFaceToJpeg only where its fixed framing fits; 6) feature-flagged rollout to a small cohort; 7) operational dashboards and fallback; 8) review whether to maintain the fork or migrate to a strategic detector.cropFaceToJpeg method modestly reduces integration glue for basic avatar cropping but does not alter the risk profile, licensing position, or strategic conclusion. Do not make it a core platform primitive. If face detection is product-critical, choose a maintained library or managed service; if privacy requires local processing, budget for an owned fork with legal review, benchmarks, provenance verification of 0.1.0, and an exit strategy.How can I help you explore Laravel packages today?