Class: Jekyll::ResponsiveImage::ImageProcessor
- Inherits:
-
Object
- Object
- Jekyll::ResponsiveImage::ImageProcessor
show all
- Includes:
- Utils
- Defined in:
- lib/jekyll/responsive_image/image_processor.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Utils
#format_output_path, #image_hash, #relative_dirname, #symbolize_keys
Class Method Details
.process(image_path, config) ⇒ Object
18
19
20
|
# File 'lib/jekyll/responsive_image/image_processor.rb', line 18
def self.process(image_path, config)
self.new.process(image_path, config)
end
|
Instance Method Details
#process(image_path, config) ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/jekyll/responsive_image/image_processor.rb', line 6
def process(image_path, config)
raise SyntaxError.new("Invalid image path specified: #{image_path}") unless File.exists?(image_path.to_s)
resize_handler = ResizeHandler.new
img = Magick::Image::read(image_path).first
{
original: image_hash(config['base_path'], image_path, img.columns, img.rows),
resized: resize_handler.resize_image(img, config),
}
end
|