6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/dragonfly/image_magick/commands.rb', line 6
def convert(content, args = "", opts = {})
convert_command = content.env[:convert_command] || "convert"
format = opts["format"]
input_args = opts["input_args"] if opts["input_args"]
delegate_string = "#{opts["delegate"]}:" if opts["delegate"]
frame_string = "[#{opts["frame"]}]" if opts["frame"]
content.shell_update :ext => format do |old_path, new_path|
"#{convert_command} #{input_args} #{delegate_string}#{old_path}#{frame_string} #{args} #{new_path}"
end
if format
content.meta["format"] = format.to_s
content.ext = format
content.meta["mime_type"] = nil end
end
|