mini_magick 4.10.1 → 5.2.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.
- checksums.yaml +4 -4
- data/README.md +558 -0
- data/lib/mini_magick/configuration.rb +39 -136
- data/lib/mini_magick/image/info.rb +18 -59
- data/lib/mini_magick/image.rb +65 -73
- data/lib/mini_magick/shell.rb +19 -47
- data/lib/mini_magick/tool.rb +56 -79
- data/lib/mini_magick/utilities.rb +4 -6
- data/lib/mini_magick/version.rb +3 -3
- data/lib/mini_magick.rb +18 -42
- metadata +20 -64
- data/lib/mini_gmagick.rb +0 -3
- data/lib/mini_magick/immutable_image.rb +0 -18
- data/lib/mini_magick/tool/animate.rb +0 -14
- data/lib/mini_magick/tool/compare.rb +0 -14
- data/lib/mini_magick/tool/composite.rb +0 -14
- data/lib/mini_magick/tool/conjure.rb +0 -14
- data/lib/mini_magick/tool/convert.rb +0 -14
- data/lib/mini_magick/tool/display.rb +0 -14
- data/lib/mini_magick/tool/identify.rb +0 -14
- data/lib/mini_magick/tool/import.rb +0 -14
- data/lib/mini_magick/tool/magick.rb +0 -14
- data/lib/mini_magick/tool/mogrify.rb +0 -14
- data/lib/mini_magick/tool/mogrify_restricted.rb +0 -15
- data/lib/mini_magick/tool/montage.rb +0 -14
- data/lib/mini_magick/tool/stream.rb +0 -14
data/lib/mini_magick/shell.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require "
|
1
|
+
require "open3"
|
2
2
|
require "benchmark"
|
3
3
|
|
4
4
|
module MiniMagick
|
@@ -10,66 +10,38 @@ module MiniMagick
|
|
10
10
|
#
|
11
11
|
class Shell
|
12
12
|
|
13
|
-
def run(command,
|
14
|
-
stdout, stderr, status = execute(command,
|
13
|
+
def run(command, errors: MiniMagick.errors, warnings: MiniMagick.warnings, **options)
|
14
|
+
stdout, stderr, status = execute(command, **options)
|
15
15
|
|
16
|
-
if status != 0
|
17
|
-
|
16
|
+
if status != 0
|
17
|
+
if stderr.include?("time limit exceeded")
|
18
|
+
fail MiniMagick::TimeoutError, "`#{command.join(" ")}` has timed out"
|
19
|
+
elsif errors
|
20
|
+
fail MiniMagick::Error, "`#{command.join(" ")}` failed with status: #{status.inspect} and error:\n#{stderr}"
|
21
|
+
end
|
18
22
|
end
|
19
23
|
|
20
|
-
$stderr.print(stderr)
|
24
|
+
$stderr.print(stderr) if warnings
|
21
25
|
|
22
26
|
[stdout, stderr, status]
|
23
27
|
end
|
24
28
|
|
25
|
-
def execute(command,
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
29
|
+
def execute(command, stdin: "", timeout: MiniMagick.timeout)
|
30
|
+
env = MiniMagick.restricted_env ? ENV.slice("HOME", "PATH", "LANG") : {}
|
31
|
+
env.merge!(MiniMagick.cli_env)
|
32
|
+
env["MAGICK_TIME_LIMIT"] = timeout.to_s if timeout
|
33
|
+
|
34
|
+
stdout, stderr, status = log(command.join(" ")) do
|
35
|
+
Open3.capture3(env, *command, stdin_data: stdin, unsetenv_others: MiniMagick.restricted_env)
|
36
|
+
end
|
30
37
|
|
31
|
-
[stdout, stderr, status
|
38
|
+
[stdout, stderr, status&.exitstatus]
|
32
39
|
rescue Errno::ENOENT, IOError
|
33
40
|
["", "executable not found: \"#{command.first}\"", 127]
|
34
41
|
end
|
35
42
|
|
36
43
|
private
|
37
44
|
|
38
|
-
def execute_open3(command, options = {})
|
39
|
-
require "open3"
|
40
|
-
|
41
|
-
# We would ideally use Open3.capture3, but it wouldn't allow us to
|
42
|
-
# terminate the command after timing out.
|
43
|
-
Open3.popen3(*command) do |in_w, out_r, err_r, thread|
|
44
|
-
[in_w, out_r, err_r].each(&:binmode)
|
45
|
-
stdout_reader = Thread.new { out_r.read }
|
46
|
-
stderr_reader = Thread.new { err_r.read }
|
47
|
-
begin
|
48
|
-
in_w.write options[:stdin].to_s
|
49
|
-
rescue Errno::EPIPE
|
50
|
-
end
|
51
|
-
in_w.close
|
52
|
-
|
53
|
-
begin
|
54
|
-
Timeout.timeout(MiniMagick.timeout) { thread.join }
|
55
|
-
rescue Timeout::Error
|
56
|
-
Process.kill("TERM", thread.pid) rescue nil
|
57
|
-
Process.waitpid(thread.pid) rescue nil
|
58
|
-
raise Timeout::Error, "MiniMagick command timed out: #{command}"
|
59
|
-
end
|
60
|
-
|
61
|
-
[stdout_reader.value, stderr_reader.value, thread.value]
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
def execute_posix_spawn(command, options = {})
|
66
|
-
require "posix-spawn"
|
67
|
-
child = POSIX::Spawn::Child.new(*command, input: options[:stdin].to_s, timeout: MiniMagick.timeout)
|
68
|
-
[child.out, child.err, child.status]
|
69
|
-
rescue POSIX::Spawn::TimeoutExceeded
|
70
|
-
raise Timeout::Error, "MiniMagick command timed out: #{command}"
|
71
|
-
end
|
72
|
-
|
73
45
|
def log(command, &block)
|
74
46
|
value = nil
|
75
47
|
duration = Benchmark.realtime { value = block.call }
|
data/lib/mini_magick/tool.rb
CHANGED
@@ -2,15 +2,13 @@ require "mini_magick/shell"
|
|
2
2
|
|
3
3
|
module MiniMagick
|
4
4
|
##
|
5
|
-
#
|
6
|
-
#
|
7
|
-
# this class if you want to be closer to the metal and execute ImageMagick
|
8
|
-
# commands directly, but still with a nice Ruby interface.
|
5
|
+
# Class that wraps command-line tools directly, as opposed MiniMagick::Image
|
6
|
+
# which is more high-level.
|
9
7
|
#
|
10
8
|
# @example
|
11
|
-
# MiniMagick
|
12
|
-
#
|
13
|
-
#
|
9
|
+
# MiniMagick.mogrify do |mogrify|
|
10
|
+
# mogrify.resize "500x500"
|
11
|
+
# mogrify << "path/to/image.jpg"
|
14
12
|
# end
|
15
13
|
#
|
16
14
|
class Tool
|
@@ -23,8 +21,7 @@ module MiniMagick
|
|
23
21
|
# executes the command in the end.
|
24
22
|
#
|
25
23
|
# @example
|
26
|
-
#
|
27
|
-
# puts version
|
24
|
+
# puts MiniMagick.identify(&:version)
|
28
25
|
#
|
29
26
|
# @return [MiniMagick::Tool, String] If no block is given, returns an
|
30
27
|
# instance of the tool, if block is given, returns the output of the
|
@@ -44,31 +41,33 @@ module MiniMagick
|
|
44
41
|
# @private
|
45
42
|
attr_reader :name, :args
|
46
43
|
|
47
|
-
# @param
|
48
|
-
#
|
44
|
+
# @param name [String]
|
45
|
+
# @param options [Hash]
|
46
|
+
# @option options [Boolean] :errors Whether to raise errors on non-zero
|
47
|
+
# exit codes.
|
48
|
+
# @option options [Boolean] :warnings Whether to print warnings to stderrr.
|
49
|
+
# @option options [String] :stdin Content to send to standard input stream.
|
49
50
|
# @example
|
50
|
-
# MiniMagick
|
51
|
+
# MiniMagick.identify(errors: false) do |identify|
|
51
52
|
# identify.help # returns exit status 1, which would otherwise throw an error
|
52
53
|
# end
|
53
|
-
def initialize(name, options
|
54
|
-
|
55
|
-
|
56
|
-
@
|
57
|
-
@args = []
|
58
|
-
@whiny = options.is_a?(Hash) ? options.fetch(:whiny, MiniMagick.whiny) : options
|
54
|
+
def initialize(name, **options)
|
55
|
+
@name = name
|
56
|
+
@args = []
|
57
|
+
@options = options
|
59
58
|
end
|
60
59
|
|
61
60
|
##
|
62
61
|
# Executes the command that has been built up.
|
63
62
|
#
|
64
63
|
# @example
|
65
|
-
# mogrify = MiniMagick
|
64
|
+
# mogrify = MiniMagick.mogrify
|
66
65
|
# mogrify.resize("500x500")
|
67
66
|
# mogrify << "path/to/image.jpg"
|
68
67
|
# mogrify.call # executes `mogrify -resize 500x500 path/to/image.jpg`
|
69
68
|
#
|
70
69
|
# @example
|
71
|
-
# mogrify = MiniMagick
|
70
|
+
# mogrify = MiniMagick.mogrify
|
72
71
|
# # build the command
|
73
72
|
# mogrify.call do |stdout, stderr, status|
|
74
73
|
# # ...
|
@@ -78,16 +77,12 @@ module MiniMagick
|
|
78
77
|
#
|
79
78
|
# @return [String] Returns the output of the command
|
80
79
|
#
|
81
|
-
def call(
|
82
|
-
options =
|
83
|
-
|
84
|
-
whiny = args.fetch(0, @whiny)
|
85
|
-
|
86
|
-
options[:whiny] = whiny
|
87
|
-
options[:stderr] = false if block_given?
|
80
|
+
def call(**options)
|
81
|
+
options = @options.merge(options)
|
82
|
+
options[:warnings] = false if block_given?
|
88
83
|
|
89
84
|
shell = MiniMagick::Shell.new
|
90
|
-
stdout, stderr, status = shell.run(command, options)
|
85
|
+
stdout, stderr, status = shell.run(command, **options)
|
91
86
|
yield stdout, stderr, status if block_given?
|
92
87
|
|
93
88
|
stdout.chomp("\n")
|
@@ -99,7 +94,7 @@ module MiniMagick
|
|
99
94
|
# @return [Array<String>]
|
100
95
|
#
|
101
96
|
# @example
|
102
|
-
# mogrify = MiniMagick
|
97
|
+
# mogrify = MiniMagick.mogrify
|
103
98
|
# mogrify.resize "500x500"
|
104
99
|
# mogrify.contrast
|
105
100
|
# mogrify.command #=> ["mogrify", "-resize", "500x500", "-contrast"]
|
@@ -110,31 +105,26 @@ module MiniMagick
|
|
110
105
|
|
111
106
|
##
|
112
107
|
# The executable used for this tool. Respects
|
113
|
-
# {MiniMagick::Configuration#
|
114
|
-
# and {MiniMagick::Configuration#cli_prefix}.
|
108
|
+
# {MiniMagick::Configuration#cli_prefix}.
|
115
109
|
#
|
116
110
|
# @return [Array<String>]
|
117
111
|
#
|
118
112
|
# @example
|
119
|
-
#
|
120
|
-
# identify
|
121
|
-
# identify.executable #=> ["gm", "identify"]
|
113
|
+
# identify = MiniMagick.identify
|
114
|
+
# identify.executable #=> ["magick", "identify"]
|
122
115
|
#
|
123
116
|
# @example
|
124
117
|
# MiniMagick.configure do |config|
|
125
|
-
# config.cli = :graphicsmagick
|
126
118
|
# config.cli_prefix = ['firejail', '--force']
|
127
119
|
# end
|
128
|
-
# identify = MiniMagick
|
129
|
-
# identify.executable #=> ["firejail", "--force", "
|
120
|
+
# identify = MiniMagick.identify
|
121
|
+
# identify.executable #=> ["firejail", "--force", "magick", "identify"]
|
130
122
|
#
|
131
123
|
def executable
|
132
|
-
exe =
|
133
|
-
exe
|
134
|
-
exe
|
135
|
-
exe
|
136
|
-
Array(MiniMagick.cli_prefix).reverse_each { |p| exe.unshift p } if MiniMagick.cli_prefix
|
137
|
-
exe
|
124
|
+
exe = Array(MiniMagick.cli_prefix)
|
125
|
+
exe << "magick" if MiniMagick.imagemagick7? && name != "magick"
|
126
|
+
exe << "gm" if MiniMagick.graphicsmagick
|
127
|
+
exe << name
|
138
128
|
end
|
139
129
|
|
140
130
|
##
|
@@ -161,7 +151,7 @@ module MiniMagick
|
|
161
151
|
# Changes the last operator to its "plus" form.
|
162
152
|
#
|
163
153
|
# @example
|
164
|
-
# MiniMagick
|
154
|
+
# MiniMagick.mogrify do |mogrify|
|
165
155
|
# mogrify.antialias.+
|
166
156
|
# mogrify.distort.+("Perspective", "0,0,4,5 89,0,45,46")
|
167
157
|
# end
|
@@ -179,7 +169,7 @@ module MiniMagick
|
|
179
169
|
# Create an ImageMagick stack in the command (surround.
|
180
170
|
#
|
181
171
|
# @example
|
182
|
-
# MiniMagick
|
172
|
+
# MiniMagick.convert do |convert|
|
183
173
|
# convert << "wand.gif"
|
184
174
|
# convert.stack do |stack|
|
185
175
|
# stack << "wand.gif"
|
@@ -190,9 +180,15 @@ module MiniMagick
|
|
190
180
|
# end
|
191
181
|
# # executes `convert wand.gif \( wizard.gif -rotate 30 \) +append images.gif`
|
192
182
|
#
|
193
|
-
def stack
|
183
|
+
def stack(*args)
|
194
184
|
self << "("
|
195
|
-
|
185
|
+
args.each do |value|
|
186
|
+
case value
|
187
|
+
when Hash then value.each { |key, value| send(key, *value) }
|
188
|
+
when String then self << value
|
189
|
+
end
|
190
|
+
end
|
191
|
+
yield self if block_given?
|
196
192
|
self << ")"
|
197
193
|
end
|
198
194
|
|
@@ -200,7 +196,7 @@ module MiniMagick
|
|
200
196
|
# Adds ImageMagick's pseudo-filename `-` for standard input.
|
201
197
|
#
|
202
198
|
# @example
|
203
|
-
# identify = MiniMagick
|
199
|
+
# identify = MiniMagick.identify
|
204
200
|
# identify.stdin
|
205
201
|
# identify.call(stdin: image_content)
|
206
202
|
# # executes `identify -` with the given standard input
|
@@ -213,7 +209,7 @@ module MiniMagick
|
|
213
209
|
# Adds ImageMagick's pseudo-filename `-` for standard output.
|
214
210
|
#
|
215
211
|
# @example
|
216
|
-
# content = MiniMagick
|
212
|
+
# content = MiniMagick.convert do |convert|
|
217
213
|
# convert << "input.jpg"
|
218
214
|
# convert.auto_orient
|
219
215
|
# convert.stdout
|
@@ -227,12 +223,13 @@ module MiniMagick
|
|
227
223
|
##
|
228
224
|
# Define creator operator methods
|
229
225
|
#
|
226
|
+
# @example
|
230
227
|
# mogrify = MiniMagick::Tool.new("mogrify")
|
231
228
|
# mogrify.canvas("khaki")
|
232
229
|
# mogrify.command.join(" ") #=> "mogrify canvas:khaki"
|
233
230
|
#
|
234
231
|
CREATION_OPERATORS.each do |operator|
|
235
|
-
define_method(operator.
|
232
|
+
define_method(operator.tr('-', '_')) do |value = nil|
|
236
233
|
self << "#{operator}:#{value}"
|
237
234
|
self
|
238
235
|
end
|
@@ -251,10 +248,11 @@ module MiniMagick
|
|
251
248
|
##
|
252
249
|
# Any undefined method will be transformed into a CLI option
|
253
250
|
#
|
251
|
+
# @example
|
254
252
|
# mogrify = MiniMagick::Tool.new("mogrify")
|
255
253
|
# mogrify.adaptive_blur("...")
|
256
254
|
# mogrify.foo_bar
|
257
|
-
# mogrify.command.join(" ") "mogrify -adaptive-blur ... -foo-bar"
|
255
|
+
# mogrify.command.join(" ") # => "mogrify -adaptive-blur ... -foo-bar"
|
258
256
|
#
|
259
257
|
def method_missing(name, *args)
|
260
258
|
option = "-#{name.to_s.tr('_', '-')}"
|
@@ -263,35 +261,14 @@ module MiniMagick
|
|
263
261
|
self
|
264
262
|
end
|
265
263
|
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
cli_options = help_page.scan(/^\s+-[a-z\-]+/).map(&:strip)
|
273
|
-
if tool.name == "mogrify" && MiniMagick.graphicsmagick?
|
274
|
-
# These options were undocumented before 2015-06-14 (see gm bug 302)
|
275
|
-
cli_options |= %w[-box -convolve -gravity -linewidth -mattecolor -render -shave]
|
264
|
+
# deprecated tool subclasses
|
265
|
+
%w[animate compare composite conjure convert display identify import magick mogrify montage stream].each do |tool|
|
266
|
+
const_set(tool.capitalize, Class.new(self) {
|
267
|
+
define_method(:initialize) do |*args|
|
268
|
+
super(tool, *args)
|
276
269
|
end
|
277
|
-
|
278
|
-
|
279
|
-
)
|
270
|
+
})
|
271
|
+
deprecate_constant(tool.capitalize)
|
280
272
|
end
|
281
|
-
|
282
273
|
end
|
283
274
|
end
|
284
|
-
|
285
|
-
require "mini_magick/tool/animate"
|
286
|
-
require "mini_magick/tool/compare"
|
287
|
-
require "mini_magick/tool/composite"
|
288
|
-
require "mini_magick/tool/conjure"
|
289
|
-
require "mini_magick/tool/convert"
|
290
|
-
require "mini_magick/tool/display"
|
291
|
-
require "mini_magick/tool/identify"
|
292
|
-
require "mini_magick/tool/import"
|
293
|
-
require "mini_magick/tool/magick"
|
294
|
-
require "mini_magick/tool/mogrify"
|
295
|
-
require "mini_magick/tool/mogrify_restricted"
|
296
|
-
require "mini_magick/tool/montage"
|
297
|
-
require "mini_magick/tool/stream"
|
@@ -24,12 +24,10 @@ module MiniMagick
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def tempfile(extension)
|
27
|
-
Tempfile.new(["mini_magick", extension]
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
end
|
27
|
+
tempfile = Tempfile.new(["mini_magick", extension], MiniMagick.tmpdir, binmode: true)
|
28
|
+
yield tempfile if block_given?
|
29
|
+
tempfile.close
|
30
|
+
tempfile
|
32
31
|
end
|
33
|
-
|
34
32
|
end
|
35
33
|
end
|
data/lib/mini_magick/version.rb
CHANGED
data/lib/mini_magick.rb
CHANGED
@@ -1,64 +1,40 @@
|
|
1
1
|
require 'mini_magick/version'
|
2
2
|
require 'mini_magick/configuration'
|
3
|
+
require 'mini_magick/utilities'
|
4
|
+
require 'mini_magick/tool'
|
5
|
+
require 'mini_magick/image'
|
3
6
|
|
4
7
|
module MiniMagick
|
5
8
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
# You might want to execute only certain blocks of processing with a
|
10
|
-
# different CLI, because for example that CLI does that particular thing
|
11
|
-
# faster. After the block CLI resets to its previous value.
|
12
|
-
#
|
13
|
-
# @example
|
14
|
-
# MiniMagick.with_cli :graphicsmagick do
|
15
|
-
# # operations that are better done with GraphicsMagick
|
16
|
-
# end
|
17
|
-
def self.with_cli(cli)
|
18
|
-
old_cli = self.cli
|
19
|
-
self.cli = cli
|
20
|
-
yield
|
21
|
-
ensure
|
22
|
-
self.cli = old_cli
|
23
|
-
end
|
9
|
+
Error = Class.new(RuntimeError)
|
10
|
+
Invalid = Class.new(StandardError)
|
11
|
+
TimeoutError = Class.new(Error)
|
24
12
|
|
25
|
-
|
26
|
-
# Checks whether the CLI used is ImageMagick.
|
27
|
-
#
|
28
|
-
# @return [Boolean]
|
29
|
-
def self.imagemagick?
|
30
|
-
cli == :imagemagick
|
31
|
-
end
|
13
|
+
extend MiniMagick::Configuration
|
32
14
|
|
33
15
|
##
|
34
|
-
# Checks whether
|
16
|
+
# Checks whether ImageMagick 7 is installed.
|
35
17
|
#
|
36
18
|
# @return [Boolean]
|
37
19
|
def self.imagemagick7?
|
38
|
-
|
20
|
+
return false if graphicsmagick
|
21
|
+
return @imagemagick7 if defined?(@imagemagick7)
|
22
|
+
@imagemagick7 = !!MiniMagick::Utilities.which("magick")
|
39
23
|
end
|
40
24
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
cli == :graphicsmagick
|
25
|
+
%w[animate compare composite conjure convert display identify import mogrify montage stream].each do |tool|
|
26
|
+
define_singleton_method(tool) do |**options, &block|
|
27
|
+
name = imagemagick7? && tool == "convert" ? "magick" : tool
|
28
|
+
MiniMagick::Tool.new(name, **options, &block)
|
29
|
+
end
|
47
30
|
end
|
48
31
|
|
49
32
|
##
|
50
|
-
# Returns ImageMagick
|
33
|
+
# Returns ImageMagick version.
|
51
34
|
#
|
52
35
|
# @return [String]
|
53
36
|
def self.cli_version
|
54
|
-
output = MiniMagick
|
37
|
+
output = MiniMagick.identify(&:version)
|
55
38
|
output[/\d+\.\d+\.\d+(-\d+)?/]
|
56
39
|
end
|
57
|
-
|
58
|
-
class Error < RuntimeError; end
|
59
|
-
class Invalid < StandardError; end
|
60
|
-
|
61
40
|
end
|
62
|
-
|
63
|
-
require 'mini_magick/tool'
|
64
|
-
require 'mini_magick/image'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_magick
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Johnson
|
@@ -10,47 +10,18 @@ authors:
|
|
10
10
|
- James Miller
|
11
11
|
- Thiago Fernandes Massa
|
12
12
|
- Janko Marohnić
|
13
|
-
autorequire:
|
14
13
|
bindir: bin
|
15
14
|
cert_chain: []
|
16
|
-
date:
|
15
|
+
date: 2025-02-22 00:00:00.000000000 Z
|
17
16
|
dependencies:
|
18
17
|
- !ruby/object:Gem::Dependency
|
19
|
-
name:
|
20
|
-
requirement: !ruby/object:Gem::Requirement
|
21
|
-
requirements:
|
22
|
-
- - ">="
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version: '0'
|
25
|
-
type: :development
|
26
|
-
prerelease: false
|
27
|
-
version_requirements: !ruby/object:Gem::Requirement
|
28
|
-
requirements:
|
29
|
-
- - ">="
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
version: '0'
|
32
|
-
- !ruby/object:Gem::Dependency
|
33
|
-
name: rspec
|
34
|
-
requirement: !ruby/object:Gem::Requirement
|
35
|
-
requirements:
|
36
|
-
- - "~>"
|
37
|
-
- !ruby/object:Gem::Version
|
38
|
-
version: 3.5.0
|
39
|
-
type: :development
|
40
|
-
prerelease: false
|
41
|
-
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
requirements:
|
43
|
-
- - "~>"
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: 3.5.0
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: guard
|
18
|
+
name: logger
|
48
19
|
requirement: !ruby/object:Gem::Requirement
|
49
20
|
requirements:
|
50
21
|
- - ">="
|
51
22
|
- !ruby/object:Gem::Version
|
52
23
|
version: '0'
|
53
|
-
type: :
|
24
|
+
type: :runtime
|
54
25
|
prerelease: false
|
55
26
|
version_requirements: !ruby/object:Gem::Requirement
|
56
27
|
requirements:
|
@@ -58,13 +29,13 @@ dependencies:
|
|
58
29
|
- !ruby/object:Gem::Version
|
59
30
|
version: '0'
|
60
31
|
- !ruby/object:Gem::Dependency
|
61
|
-
name:
|
32
|
+
name: benchmark
|
62
33
|
requirement: !ruby/object:Gem::Requirement
|
63
34
|
requirements:
|
64
35
|
- - ">="
|
65
36
|
- !ruby/object:Gem::Version
|
66
37
|
version: '0'
|
67
|
-
type: :
|
38
|
+
type: :runtime
|
68
39
|
prerelease: false
|
69
40
|
version_requirements: !ruby/object:Gem::Requirement
|
70
41
|
requirements:
|
@@ -72,7 +43,7 @@ dependencies:
|
|
72
43
|
- !ruby/object:Gem::Version
|
73
44
|
version: '0'
|
74
45
|
- !ruby/object:Gem::Dependency
|
75
|
-
name:
|
46
|
+
name: rake
|
76
47
|
requirement: !ruby/object:Gem::Requirement
|
77
48
|
requirements:
|
78
49
|
- - ">="
|
@@ -86,20 +57,20 @@ dependencies:
|
|
86
57
|
- !ruby/object:Gem::Version
|
87
58
|
version: '0'
|
88
59
|
- !ruby/object:Gem::Dependency
|
89
|
-
name:
|
60
|
+
name: rspec
|
90
61
|
requirement: !ruby/object:Gem::Requirement
|
91
62
|
requirements:
|
92
|
-
- - "
|
63
|
+
- - "~>"
|
93
64
|
- !ruby/object:Gem::Version
|
94
|
-
version: '
|
65
|
+
version: '3.5'
|
95
66
|
type: :development
|
96
67
|
prerelease: false
|
97
68
|
version_requirements: !ruby/object:Gem::Requirement
|
98
69
|
requirements:
|
99
|
-
- - "
|
70
|
+
- - "~>"
|
100
71
|
- !ruby/object:Gem::Version
|
101
|
-
version: '
|
102
|
-
description: Manipulate images with minimal use of memory via ImageMagick
|
72
|
+
version: '3.5'
|
73
|
+
description: Manipulate images with minimal use of memory via ImageMagick
|
103
74
|
email:
|
104
75
|
- probablycorey@gmail.com
|
105
76
|
- hcatlin@gmail.com
|
@@ -112,35 +83,21 @@ extensions: []
|
|
112
83
|
extra_rdoc_files: []
|
113
84
|
files:
|
114
85
|
- MIT-LICENSE
|
86
|
+
- README.md
|
115
87
|
- Rakefile
|
116
|
-
- lib/mini_gmagick.rb
|
117
88
|
- lib/mini_magick.rb
|
118
89
|
- lib/mini_magick/configuration.rb
|
119
90
|
- lib/mini_magick/image.rb
|
120
91
|
- lib/mini_magick/image/info.rb
|
121
|
-
- lib/mini_magick/immutable_image.rb
|
122
92
|
- lib/mini_magick/shell.rb
|
123
93
|
- lib/mini_magick/tool.rb
|
124
|
-
- lib/mini_magick/tool/animate.rb
|
125
|
-
- lib/mini_magick/tool/compare.rb
|
126
|
-
- lib/mini_magick/tool/composite.rb
|
127
|
-
- lib/mini_magick/tool/conjure.rb
|
128
|
-
- lib/mini_magick/tool/convert.rb
|
129
|
-
- lib/mini_magick/tool/display.rb
|
130
|
-
- lib/mini_magick/tool/identify.rb
|
131
|
-
- lib/mini_magick/tool/import.rb
|
132
|
-
- lib/mini_magick/tool/magick.rb
|
133
|
-
- lib/mini_magick/tool/mogrify.rb
|
134
|
-
- lib/mini_magick/tool/mogrify_restricted.rb
|
135
|
-
- lib/mini_magick/tool/montage.rb
|
136
|
-
- lib/mini_magick/tool/stream.rb
|
137
94
|
- lib/mini_magick/utilities.rb
|
138
95
|
- lib/mini_magick/version.rb
|
139
96
|
homepage: https://github.com/minimagick/minimagick
|
140
97
|
licenses:
|
141
98
|
- MIT
|
142
|
-
metadata:
|
143
|
-
|
99
|
+
metadata:
|
100
|
+
changelog_uri: https://github.com/minimagick/minimagick/releases
|
144
101
|
rdoc_options: []
|
145
102
|
require_paths:
|
146
103
|
- lib
|
@@ -148,16 +105,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
148
105
|
requirements:
|
149
106
|
- - ">="
|
150
107
|
- !ruby/object:Gem::Version
|
151
|
-
version: '2.
|
108
|
+
version: '2.3'
|
152
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
110
|
requirements:
|
154
111
|
- - ">="
|
155
112
|
- !ruby/object:Gem::Version
|
156
113
|
version: '0'
|
157
114
|
requirements:
|
158
|
-
- You must have ImageMagick
|
159
|
-
rubygems_version: 3.
|
160
|
-
signing_key:
|
115
|
+
- You must have ImageMagick installed
|
116
|
+
rubygems_version: 3.6.2
|
161
117
|
specification_version: 4
|
162
|
-
summary: Manipulate images with minimal use of memory via ImageMagick
|
118
|
+
summary: Manipulate images with minimal use of memory via ImageMagick
|
163
119
|
test_files: []
|
data/lib/mini_gmagick.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
module MiniMagick
|
2
|
-
class Image
|
3
|
-
def initialize(source)
|
4
|
-
if source.is_a?(String) || source.is_a?(Pathname)
|
5
|
-
@source_path = source.to_s
|
6
|
-
elsif source.respond_to?(:path)
|
7
|
-
@source_path = source.path
|
8
|
-
else
|
9
|
-
fail ArgumentError, "invalid source object: #{source.inspect} (expected String, Pathname or #path)"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def method_missing
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
image = MiniMagick::Image.new()
|