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

+ (Object) load_image(filename)



305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# File 'lib/carrierwave/test/matchers.rb', line 305

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