Class: CarrierWave::Test::Matchers::ImageLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/carrierwave/test/matchers.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.load_image(filename) ⇒ Object



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/carrierwave/test/matchers.rb', line 278

def self.load_image(filename)
  if defined? ::MiniMagick
    MiniMagickWrapper.new(filename)
  else
    unless defined? ::Magick
      begin
        require 'rmagick'
      rescue LoadError
        require 'RMagick'
      rescue LoadError
        puts "WARNING: Failed to require rmagick, image processing may fail!"
      end
    end
    MagickWrapper.new(filename)
  end
end