def resize_to_fill(new_width, new_height)
      manipulate! do |image|

        image = resize_image image, new_width, new_height, :max

        if image.width > new_width
          top = 0
          left = (image.width - new_width) / 2
        elsif image.height > new_height
          left = 0
          top = (image.height - new_height) / 2
        else
          left = 0
          top = 0
        end

        # Floating point errors can sometimes chop off an extra pixel
        # TODO: fix all the universe so that floating point errors never happen again
        new_height = image.height if image.height < new_height
        new_width = image.width if image.width < new_width

        image.extract_area(left, top, new_width, new_height)

      end
    end
def resize_to_fill(new_width, new_height)
      manipulate! do |image|

        image = resize_image image, new_width, new_height, :max

        if image.width > new_width
          top = 0
          left = (image.width - new_width) / 2
        elsif image.height > new_height
          left = 0
          top = (image.height - new_height) / 2
        else
          left = 0
          top = 0
        end

        # Floating point errors can sometimes chop off an extra pixel
        # TODO: fix all the universe so that floating point errors never happen again
        new_height = image.height if image.height < new_height
        new_width = image.width if image.width < new_width

        image.extract_area(left, top, new_width, new_height)

      end
    end
Resize the image to fit within the specified dimensions while retaining
 the aspect ratio of the original image. If necessary, crop the image in
 the larger dimension.


 === Parameters

 [width (Integer)] the width to scale the image to
 [height (Integer)] the height to scale the image to