I have a function that detects the face position of the person in an image and returns the X, Y, W, H or it can return the cut image of the face.
I need to display a photo of a person and I'm currently doing:
<?= wp_get_attachment_image( 1497, 'custom-small-thumb' ) ?>
Right, it displays the photo using the classic Wordpress resize / crop function.
BUT what I REALLY NEED is to display only the face that appears in this image, and I did not want to do any gambiarra, I would use the maximum resources of Wordpress for this purpose.
I have a function faceDetector($imagesrc)
and I would like to know if you have any hook that I can do to run faceDetector before wp_get_attachment_image in> .
In fact I'd like a lot of something like
<?= wp_get_attachment_image ( 1497, 'face-small-thumb' ) ?>
But WP does not let us pass a custom function on add_image_size .