remvee-mini_magick 1.2.3.3 → 1.2.3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/mini_magick.rb +10 -6
- data/mini_magick.gemspec +1 -1
- metadata +1 -1
data/lib/mini_magick.rb
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
require "open-uri"
|
2
2
|
require "stringio"
|
3
3
|
require "fileutils"
|
4
|
+
require "open3"
|
4
5
|
|
5
6
|
require File.join(File.dirname(__FILE__), '/image_temp_file')
|
6
7
|
|
7
8
|
module MiniMagick
|
8
9
|
class MiniMagickError < RuntimeError; end
|
9
10
|
|
10
|
-
VERSION = '1.2.3.
|
11
|
+
VERSION = '1.2.3.4.0'
|
11
12
|
|
12
13
|
class Image
|
13
14
|
attr :path
|
@@ -144,16 +145,19 @@ module MiniMagick
|
|
144
145
|
def run_command(command, *args)
|
145
146
|
args.collect! do |arg|
|
146
147
|
arg = arg.to_s
|
147
|
-
|
148
|
+
unless arg[0] == ?- # values quoted because they can contain characters like '>', but don't quote switches
|
149
|
+
arg = %|"#{arg}"|
|
150
|
+
end
|
148
151
|
arg
|
149
152
|
end
|
150
153
|
|
151
|
-
|
154
|
+
command = "#{command} #{args.join(' ')}"
|
155
|
+
output = `#{command} 2>&1`
|
152
156
|
|
153
|
-
if
|
154
|
-
raise MiniMagickError, "ImageMagick command (#{command} #{
|
157
|
+
if $?.exitstatus != 0
|
158
|
+
raise MiniMagickError, "ImageMagick command (#{command.inspect}) failed: #{{:status_code => $?, :output => output}.inspect}"
|
155
159
|
else
|
156
|
-
|
160
|
+
output
|
157
161
|
end
|
158
162
|
end
|
159
163
|
end
|
data/mini_magick.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.platform = Gem::Platform::RUBY
|
3
3
|
s.name = 'mini_magick'
|
4
|
-
s.version = "1.2.3.
|
4
|
+
s.version = "1.2.3.4.0"
|
5
5
|
s.summary = "Manipulate images with minimal use of memory."
|
6
6
|
s.description = %q{Uses command-line ImageMagick tools to resize, rotate, and mogrify images.}
|
7
7
|
|