Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add composite command

  • Loading branch information...
commit 353c419ca06e7289b16766143bfd27d1cd7d256b 1 parent 85643a5
@EricR authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 lib/image_sorcery.rb
View
13 lib/image_sorcery.rb
@@ -21,6 +21,19 @@ def manipulate!(args={})
success
end
+ # Runs ImageMagick's 'composite'.
+ # See http://www.imagemagick.org/script/composite.php
+ #
+ def composite!(output, args={})
+ tokens = ["composite"]
+ tokens << convert_to_arguments(args) if args
+ tokens << " '#{@file}#{"[#{args[:layer].to_s}]" if args[:layer]}'"
+ tokens << " -annotate #{args[:annotate].to_s}" if args[:annotate]
+ tokens = convert_to_command(tokens)
+ success = run(tokens)[1]
+ success
+ end
+
# Runs ImageMagick's 'convert'.
# See http://www.imagemagick.org/script/convert.php
#
Please sign in to comment.
Something went wrong with that request. Please try again.