module ImageProcessing::Vips

def self.valid_image?(file)

Returns whether the given image file is processable.
def self.valid_image?(file)
  ::Vips::Image.new_from_file(file.path, access: :sequential).avg
  true
rescue ::Vips::Error
  false
end