1
votes

No matter the position I put, it seems Wordpress hard crop is constantly cropping from the center.

add_image_size('attorney-thumb', 81,81, array( 'center', 'top' ));

If this crops from the center of x-axis, and top of y-axis. Then none of my thumbnails should have people's head's cut off.

Has anyone else had issues with wordpress hard crop not working? I would hate to create a custom image field to load images that are properly cropped.

1
After every change you make to add_image_size, you'll need to regenerate thumbnails to see the correct images. Regenerate Thumnails Plugin You'll need to select that size, "attorney-thumb" for those images in the post or change your template file to use that size. - Poldira
Yes, I did all this before posting the question. I also have thumbnail support in my theme. The thumbnail spits out and at the right size, but just does not crop the correct way that Wordpress suggests. - Blake
@DarthVader this plugin is linked throughout StackOverflow and has well over 1 million installs from the repository. Even WP-CLI doesn't offer enough flexibility to do something like this with a massive library. - Poldira
If you've done the regen, when you inspect the images, do the urls to the images look correct when you view them? Are they cropped correctly? If so, then there might be some CSS that is positioning the images strangely. - Poldira

1 Answers

0
votes

It seems this fixed itself on other sites. It could of been anywhere from Wordpress not doing what I want and eventually modifying their image crop to be better. I really don't know.