Module: ImageInfo

Extended by:
Configurable
Defined in:
lib/image_info.rb,
lib/image_info/image.rb,
lib/image_info/parser.rb,
lib/image_info/version.rb,
lib/image_info/processor.rb,
lib/image_info/null_parser.rb,
lib/image_info/configurable.rb,
lib/image_info/configuration.rb,
lib/image_info/request_handler.rb

Defined Under Namespace

Modules: Configurable Classes: Configuration, Image, NullParser, Parser, Processor, RequestHandler

Constant Summary collapse

VERSION =
'1.2.1'.freeze

Class Method Summary collapse

Methods included from Configurable

config, configure

Class Method Details

.from(urls, options = { max_concurrency: config.max_concurrency }) ⇒ Array<ImageInfo::Image>

Returns type and size given an url or a list of urls.

Examples:

ImageInfo.from('http://foo.com/foo.png').first.size
 => [250, 86]
ImageInfo.from(['http://foo.com/foo.png', 'http://foo.com/bar.jpeg']).map(&:type)
 => [:png, :jpeg]

Returns:



19
20
21
# File 'lib/image_info.rb', line 19

def self.from(urls, options = { max_concurrency: config.max_concurrency })
  ::ImageInfo::Processor.new(urls, options).process
end