def crop_geometry(ratio_vector)
      # Maximize the crop area to fit the image size
      crop_size = ratio_vector.fit(size).round

      # Ignore pixels outside the pre-cropped area for now
      center = crop_gravity - crop_start

      start = center - (crop_size / 2).floor
      start = clamp(start, crop_size, size)

      [crop_size, (start + crop_start)]
    end
def crop_geometry(ratio_vector)
      # Maximize the crop area to fit the image size
      crop_size = ratio_vector.fit(size).round

      # Ignore pixels outside the pre-cropped area for now
      center = crop_gravity - crop_start

      start = center - (crop_size / 2).floor
      start = clamp(start, crop_size, size)

      [crop_size, (start + crop_start)]
    end
Calculates crop geometry. The given vector is scaled
 to match the image size, since DynamicImage performs
 cropping before resizing.

 ==== Example

   image = Image.find(params[:id]) # 320x200 image
   sizing = DynamicImage::ImageSizing.new(image)

   sizing.crop_geometry(Vector2d(100, 100))
   # => [Vector2d(200, 200), Vector2d(60, 0)]

 Returns a tuple with crop size and crop start vectors.