def get_random_parts(image, options={})
      # 图片切割份数
      part_count = options.fetch(:part_count, rand(5..10)).to_i.abs

      part_count.times.map do |index|
        tmp_height = (image.height / part_count).to_i

        x = rand(1...image.width)
        y = rand(1...tmp_height) + index * tmp_height

        part_width = options.fetch(:part_width, rand(10..30)).to_i.abs
        part_height = options.fetch(:part_height, rand(10..30)).to_i.abs

        [x, y, part_width, part_height]
      end
    end
def get_random_parts(image, options={})
      # 图片切割份数
      part_count = options.fetch(:part_count, rand(5..10)).to_i.abs

      part_count.times.map do |index|
        tmp_height = (image.height / part_count).to_i

        x = rand(1...image.width)
        y = rand(1...tmp_height) + index * tmp_height

        part_width = options.fetch(:part_width, rand(10..30)).to_i.abs
        part_height = options.fetch(:part_height, rand(10..30)).to_i.abs

        [x, y, part_width, part_height]
      end
    end
随机获取图片切片位置以及大小信息