Permalink
Browse files

Add composite command

  • Loading branch information...
1 parent 85643a5 commit 353c419ca06e7289b16766143bfd27d1cd7d256b @EricR committed Jan 21, 2013
Showing with 13 additions and 0 deletions.
  1. +13 −0 lib/image_sorcery.rb
View
@@ -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
#

0 comments on commit 353c419

Please sign in to comment.