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



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/carrierwave/test/matchers.rb', line 113

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