I cannot count how many times I used add_image_size to register custom image sizes in WordPress, but I never realized that instead of true/false you can also set the crop area by using an array in the fourth parameter.
add_image_size( 'image-size-name', 250, 250, array( 'center', 'center' ) );Code language: PHP (php)
Any of the following keyword combinations:
left / topleft / centerleft / bottomright / topright / centerright / bottomcenter / topcenter / centercenter / bottom
