Stop WordPress from cropping images using url parameters
I've specified some custom image sizes each with a non-default crop position (e.g. top-center). However, when I use wp_get_attachment_image
and specify size
to be one that I defined, I get a correctly sized image with an incorrect crop position.
It turns out that the image URI is of the form https://i1.wp.com/example.com/wp-content/uploads/2017/11/myimage.jpg?resize=293%2C160
, even though I definitely have the proper https://example.com/wp-content/uploads/2017/11/myimage-293x160.jpg
image with correct crop position. Interestingly, though, wp_get_attachment_metadata
returns the correct, static URI for the given image size.
Why is WordPress deferring to dynamic resizing? Is this somehow prefereble? In any case, how can I disable it?