Ruby on rails Rails peperclip-帮助裁剪图像
欢迎,帮助裁剪图像 已附加文件:图像,样式:{show:'540x505} 根据需要修剪,但居中(向上),我需要图像不居中,并修剪顶部 原始图像: 需要: 定义曲别针样式时,您希望将选项设置为北。类似于Ruby on rails Rails peperclip-帮助裁剪图像,ruby-on-rails,imagemagick,Ruby On Rails,Imagemagick,欢迎,帮助裁剪图像 已附加文件:图像,样式:{show:'540x505} 根据需要修剪,但居中(向上),我需要图像不居中,并修剪顶部 原始图像: 需要: 定义曲别针样式时,您希望将选项设置为北。类似于 已附加文件:图像, 样式:{show:'540x505'}, 转换选项:{show:'-重力北'} 请参阅文档和示例用法。回答: has_attached_file :image, styles: { show: '' }, convert_options:
已附加文件:图像,
样式:{show:'540x505'},
转换选项:{show:'-重力北'}
请参阅文档和示例用法。回答:
has_attached_file :image, styles: { show: '' },
convert_options: {show: '-gravity north -thumbnail 540x505^ -extent 540x505' }