Skip to content

Commit

Permalink
Add composite command
Browse files Browse the repository at this point in the history
  • Loading branch information
EricR committed Jan 21, 2013
1 parent 85643a5 commit 353c419
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/image_sorcery.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down

0 comments on commit 353c419

Please sign in to comment.