Module: Lizard
- Defined in:
- lib/lizard.rb,
lib/lizard/color.rb,
lib/lizard/error.rb,
lib/lizard/image.rb,
lib/lizard/version.rb,
lib/lizard/histogram.rb,
lib/lizard/color_profiles.rb
Defined Under Namespace
Classes: Color, CropFailed, Error, Histogram, Image, InvalidFileType, InvalidResizeMode, NotAnImage, ResizeFailed
Constant Summary
collapse
- VERSION =
'1.0.1'
- COLOR_PROFILES =
{
'CMYK' => File.join(root, 'colorspaces', 'CMYK', 'CoatedFOGRA39.icc'),
'RGB' => File.join(root, 'colorspaces', 'RGB', 'sRGB_IEC61966-2-1_no_black_scaling.icc')
}
Class Method Summary
collapse
Class Method Details
.root ⇒ Object
4
5
6
|
# File 'lib/lizard.rb', line 4
def self.root
File.expand_path('../../', __FILE__)
end
|
.run_command(command, input = nil) ⇒ Object
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/lizard.rb', line 8
def self.run_command(command, input = nil)
command = [command] unless command.is_a?(Array)
stdin, stdout, stderr, wait_thr = Open3.popen3(*command)
stdin.binmode
stdout.binmode
stderr.binmode
stdin.write(input) if input
stdin.close
[stdout.read, stderr.read, wait_thr.value.to_i]
end
|