#7 楼 @2297028416 #5 楼 @zhf 把 start 改成 run
#3 楼 @yesmeck 自己解决了 image.combine_options do |cmd| cmd.thumbnail "#{640}x#{366}>" cmd.background "#FFFFFF" cmd.gravity "center" cmd.extent "#{640}x#{366}" end
#3 楼 @yesmeck image = MiniMagick::Image.open(image_path) crop_params = "#{w}x#{h}+#{x}+#{y}" image.crop(crop_params) image.resize_and_pad '640x366' image.write(image_path)
image = MiniMagick::Image.open(image_path) crop_params = "#{w}x#{h}+#{x}+#{y}" image.crop(crop_params) image.resize_and_pad '640x366' image.write(image_path) 这样写会报错!求指点应该怎么改写!