Module: MiniMagick
- Defined in:
- lib/mini_magick.rb,
lib/mini_magick/version.rb
Defined Under Namespace
Classes: CommandBuilder, Error, Image, Invalid
Constant Summary collapse
- MOGRIFY_COMMANDS =
%w{adaptive-blur adaptive-resize adaptive-sharpen adjoin affine alpha annotate antialias append attenuate authenticate auto-gamma auto-level auto-orient backdrop background bench bias black-point-compensation black-threshold blend blue-primary blue-shift blur border bordercolor borderwidth brightness-contrast cache caption cdl channel charcoal chop clamp clip clip-mask clip-path clone clut coalesce colorize colormap color-matrix colors colorspace combine comment compose composite compress contrast contrast-stretch convolve crop cycle debug decipher deconstruct define delay delete density depth descend deskew despeckle direction displace display dispose dissimilarity-threshold dissolve distort dither draw duplicate edge emboss encipher encoding endian enhance equalize evaluate evaluate-sequence extent extract family features fft fill filter flatten flip floodfill flop font foreground format frame function fuzz fx gamma gaussian-blur geometry gravity green-primary hald-clut help highlight-color iconGeometry iconic identify ift immutable implode insert intent interlace interpolate interline-spacing interword-spacing kerning label lat layers level level-colors limit linear-stretch linewidth liquid-rescale list log loop lowlight-color magnify map mask mattecolor median metric mode modulate monitor monochrome morph morphology mosaic motion-blur name negate noise normalize opaque ordered-dither orient page paint path pause pen perceptible ping pointsize polaroid poly posterize precision preview print process profile quality quantize quiet radial-blur raise random-threshold red-primary regard-warnings region remap remote render repage resample resize respect-parentheses reverse roll rotate sample sampling-factor scale scene screen seed segment selective-blur separate sepia-tone set shade shadow shared-memory sharpen shave shear sigmoidal-contrast silent size sketch smush snaps solarize sparse-color splice spread statistic stegano stereo stretch strip stroke strokewidth style subimage-search swap swirl synchronize taint text-font texture threshold thumbnail tile tile-offset tint title transform transparent transparent-color transpose transverse treedepth trim type undercolor unique-colors units unsharp update verbose version view vignette virtual-pixel visual watermark wave weight white-point white-threshold window window-group write}
- IMAGE_CREATION_OPERATORS =
%w{canvas caption gradient label logo pattern plasma radial radient rose text tile xc }
- VERSION =
"3.5.0"
Class Attribute Summary collapse
-
.processor ⇒ Object
Returns the value of attribute processor.
-
.processor_path ⇒ Object
Returns the value of attribute processor_path.
-
.timeout ⇒ Object
Returns the value of attribute timeout.
Class Method Summary collapse
-
.choose_processor ⇒ Object
Experimental method for automatically selecting a processor such as gm.
- .image_magick_version ⇒ Object
- .minimum_image_magick_version ⇒ Object
- .valid_version_installed? ⇒ Boolean
- .windows? ⇒ Boolean
Class Attribute Details
.processor ⇒ Object
Returns the value of attribute processor.
9 10 11 |
# File 'lib/mini_magick.rb', line 9 def processor @processor end |
.processor_path ⇒ Object
Returns the value of attribute processor_path.
10 11 12 |
# File 'lib/mini_magick.rb', line 10 def processor_path @processor_path end |
.timeout ⇒ Object
Returns the value of attribute timeout.
11 12 13 |
# File 'lib/mini_magick.rb', line 11 def timeout @timeout end |
Class Method Details
.choose_processor ⇒ Object
Experimental method for automatically selecting a processor such as gm. Only works on *nix.
TODO: Write tests for this and figure out what platforms it supports
18 19 20 21 22 23 24 |
# File 'lib/mini_magick.rb', line 18 def choose_processor if `type -P mogrify`.size > 0 return elsif `type -P gm`.size > 0 self.processor = "gm" end end |
.image_magick_version ⇒ Object
30 31 32 |
# File 'lib/mini_magick.rb', line 30 def image_magick_version @@version ||= Gem::Version.create(`mogrify --version`.split(" ")[2].split("-").first) end |
.minimum_image_magick_version ⇒ Object
34 35 36 |
# File 'lib/mini_magick.rb', line 34 def minimum_image_magick_version @@minimum_version ||= Gem::Version.create("6.6.3") end |
.valid_version_installed? ⇒ Boolean
38 39 40 |
# File 'lib/mini_magick.rb', line 38 def valid_version_installed? image_magick_version >= minimum_image_magick_version end |
.windows? ⇒ Boolean
26 27 28 |
# File 'lib/mini_magick.rb', line 26 def windows? RUBY_PLATFORM =~ /mswin|mingw|cygwin/ end |