I've modified run_command in my local copy as follows to better help track down errors. The standard behavior to just report exit code didn't help too much. I know, I *should* know what it means when mogrify returns with an exit status of -32223, but I'm a slacker.
This has it report both the stdout and stderr of the command execution. Since imagemagick won't output anything on stderr by default if there is no errors, it doesn't effect normal operations.
--------
def run_command(command, *args)
args = args.collect do |a|
a = a.to_s
unless a[0,1] == '-' # don't quote switches
"\"#{a}\"" # values quoted because they can contain characters like '>'
else
a
end
end
command = "#{command} #{args.join(' ')} 2>&1"
output = `#{command}`
if $? != 0
raise MiniMagickError, "ImageMagick command '#{command}' failed. Error Code was: #{$?}; output was: '#{output}'"
else
return output
end
end
end
|