gpt4 book ai didi

ruby-on-rails - ImageMagick 中的哈希 (#) 调整大小选项是什么?

转载 作者:行者123 更新时间:2023-12-04 11:07:13 25 4
gpt4 key购买 nike

刚刚遇到这个调整大小选项“300x300#”,想知道散列选项是什么意思? ImageMagick 官方文档中似乎没有关于此选项的内容。

最佳答案

根据 Paperclip's API documentation :

Paperclip also adds the “#” option (e.g. “50x50#”), which will resize the image to fit maximally inside the dimensions and then crop the rest off (weighted at the center).



因此,如果您上传 120x100 图像并裁剪为“50x50#”,它会将图像大小调整为 60x50,然后使用图像的质心作为 anchor 裁剪 50x50(从而从左侧移除 5px,从右侧移除 5px)。

关于ruby-on-rails - ImageMagick 中的哈希 (#) 调整大小选项是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21471096/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com