最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

functions - How to crop image in WordPress with aspect ratio for any size of image

programmeradmin1浏览0评论

I am using following function for cropping image in wordpress and I want to crop image in 1:1 aspect ratio. When I upload large image compared to specified size in function it works well but when I upload smaller image compare to specified in function size it does not produce 1:1 but it takes height or width that fits best and produce image in other aspect ratio.

add_image_size('member-photo', 200, 200, true);

/

But I need 1:1 image in ratio so when ever user upload any size of image it cropped in that ratio.

Note: I don't want to use different sizes of images.

发布评论

评论列表(0)

  1. 暂无评论