Sha256: 0cfdc51529bacef286bdffc34a41d6ba4b3a539d79dd8640645c9f60dffe6f1e

Contents?: true

Size: 292 Bytes

Versions: 8

Compression:

Stored size: 292 Bytes

Contents

module Sprite
  class ImageReader
    def self.read(image_filename)
      # avoid loading rmagick till the last possible moment
      begin
        require "RMagick"
      rescue LoadError
        require 'rmagick'
      end

      Magick::Image::read(image_filename).first
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sprite-0.3.0 lib/sprite/image_reader.rb
sprite-0.2.7 lib/sprite/image_reader.rb
sprite-0.2.6 lib/sprite/image_reader.rb
sprite-0.2.5 lib/sprite/image_reader.rb
sprite-0.2.4 lib/sprite/image_reader.rb
sprite-0.2.2 lib/sprite/image_reader.rb
sprite-0.2.1 lib/sprite/image_reader.rb
sprite-0.2.0 lib/sprite/image_reader.rb