phpfacebookcrop

Facebook like automatic image crop with intelligent results


I have noticed that every image I upload to Facebook is cropped automatically for the thumbnails. By automatically I mean that the user is not involved in setting the crop params in any way. The thing that is bugging me is that even with auto crop the thumbnails Facebook gets in the end are intelligent (they somehow crop the exact area where the face or the figure of the person is). How is that possible and how to do it in PHP?

P.S. I can't install install things to the server. And even without a face detection is there someway to make a good guess. I have noticed that for larger images facebook requires manual crops and does auto crop only for smaller images. The main goal is to make smart square crops and then resize them for thumbnails.


Solution

  • There's also a jquery plugin which can do face detection so you could use the coordinates that it comes up with in a php script to crop the image. http://papermashup.com/jquery-face-detection/