admin管理员组文章数量:1418103
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 /wp-content/uploads/2017/11/myimage.jpg?resize=293%2C160
, even though I definitely have the proper .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?
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/example/wp-content/uploads/2017/11/myimage.jpg?resize=293%2C160
, even though I definitely have the proper https://example/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?
Share Improve this question asked Nov 2, 2017 at 0:20 Joel ChristophelJoel Christophel 1336 bronze badges 4- 3 Are you on a wp site? Or have Jetpack photon turned on? Standard WP doesn't generate images on the fly via URL, the images are just served straight off of the file system – Tom J Nowell ♦ Commented Nov 2, 2017 at 0:47
- 1 Turns out that Jetpack came preinstalled, and with Photon enabled. One flick of a toggle switch and my problem is solved. Thanks much! Turn your comment into a question for reputation if you so please. – Joel Christophel Commented Nov 2, 2017 at 0:54
- 1 Into an *answer haha – Joel Christophel Commented Nov 2, 2017 at 1:07
- Great answer Tom J Nowell: In my case I had to switch off the option "Speed up your site > Serve images from our servers" in the JetPack settings – bgx Commented Jun 5, 2018 at 9:52
1 Answer
Reset to default -1Please try this plugin for regenerate image thumbnail and then try to display it.Thumnail regenerate plugin
本文标签: Stop WordPress from cropping images using url parameters
版权声明:本文标题:Stop WordPress from cropping images using url parameters 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745273738a2651051.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论