Browse files

Restore compatibility with GraphicsMagick.

Commit 302aaa3 added the -quiet option on
identify commands. This broke compatibility with
GraphicsMagick as there is no such option for
their implementation identify. It may make more
sense to put in the mini_gmagick file but here's
the quick fix.
  • Loading branch information...
1 parent 496af2e commit 432c91349b5dd572f5f5d21189fcd89c0f36e471 @gmanley gmanley committed Jan 2, 2012
Showing with 9 additions and 4 deletions.
  1. +9 −4 lib/mini_magick.rb
View
13 lib/mini_magick.rb
@@ -21,15 +21,15 @@ def choose_processor
self.processor = "gm"
end
end
-
+
def image_magick_version
@@version ||= Gem::Version.create(`mogrify --version`.split(" ")[2].split("-").first)
end
-
+
def minimum_image_magick_version
@@minimum_version ||= Gem::Version.create("6.6.3")
end
-
+
def valid_version_installed?
image_magick_version >= minimum_image_magick_version
end
@@ -395,6 +395,11 @@ def run_command(command, *args)
# -ping "efficiently determine image characteristics."
if command == 'identify'
args.unshift '-ping'
+
+ # GraphicsMagick's identify has no -quiet option
+ if MiniMagick.processor.to_s == 'gm'
+ args.delete('-quiet')
+ end
end
run(CommandBuilder.new(command, *args))
@@ -486,7 +491,7 @@ def add_command(command, *options)
end
end
end
-
+
def escape_string(value)
Shellwords.escape(value.to_s)
end

0 comments on commit 432c913

Please sign in to comment.