class ImageProcessing::Vips::Processor

def convert_to_image(object, name)

Converts the image on disk in various forms into a Vips::Image object.
def convert_to_image(object, name)
  return object if object.is_a?(::Vips::Image)
  if object.is_a?(String)
    path = object
  elsif object.respond_to?(:to_path)
    path = object.to_path
  elsif object.respond_to?(:path)
    path = object.path
  else
    raise ArgumentError, "#{name} must be a Vips::Image, String, Pathname, or respond to #path"
  end
  ::Vips::Image.new_from_file(path)
end