mini_magick 4.13.2 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +71 -104
- data/lib/mini_magick/configuration.rb +4 -136
- data/lib/mini_magick/image/info.rb +7 -60
- data/lib/mini_magick/image.rb +30 -71
- data/lib/mini_magick/shell.rb +14 -45
- data/lib/mini_magick/tool.rb +37 -70
- data/lib/mini_magick/utilities.rb +4 -6
- data/lib/mini_magick/version.rb +3 -3
- data/lib/mini_magick.rb +17 -42
- metadata +6 -19
- data/lib/mini_gmagick.rb +0 -3
- 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.rb
CHANGED
@@ -1,64 +1,39 @@
|
|
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 @imagemagick7 if defined?(@imagemagick7)
|
21
|
+
@imagemagick7 = !!MiniMagick::Utilities.which("magick")
|
39
22
|
end
|
40
23
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
cli == :graphicsmagick
|
24
|
+
%w[animate compare composite conjure convert display identify import mogrify montage stream].each do |tool|
|
25
|
+
name = imagemagick7? && tool == "convert" ? "magick" : tool
|
26
|
+
define_singleton_method(tool) do |**options, &block|
|
27
|
+
MiniMagick::Tool.new(name, **options, &block)
|
28
|
+
end
|
47
29
|
end
|
48
30
|
|
49
31
|
##
|
50
|
-
# Returns ImageMagick
|
32
|
+
# Returns ImageMagick version.
|
51
33
|
#
|
52
34
|
# @return [String]
|
53
35
|
def self.cli_version
|
54
|
-
output = MiniMagick
|
36
|
+
output = MiniMagick.identify(&:version)
|
55
37
|
output[/\d+\.\d+\.\d+(-\d+)?/]
|
56
38
|
end
|
57
|
-
|
58
|
-
class Error < RuntimeError; end
|
59
|
-
class Invalid < StandardError; end
|
60
|
-
|
61
39
|
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.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Johnson
|
@@ -57,7 +57,7 @@ dependencies:
|
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: '0'
|
60
|
-
description: Manipulate images with minimal use of memory via ImageMagick
|
60
|
+
description: Manipulate images with minimal use of memory via ImageMagick
|
61
61
|
email:
|
62
62
|
- probablycorey@gmail.com
|
63
63
|
- hcatlin@gmail.com
|
@@ -72,32 +72,19 @@ files:
|
|
72
72
|
- MIT-LICENSE
|
73
73
|
- README.md
|
74
74
|
- Rakefile
|
75
|
-
- lib/mini_gmagick.rb
|
76
75
|
- lib/mini_magick.rb
|
77
76
|
- lib/mini_magick/configuration.rb
|
78
77
|
- lib/mini_magick/image.rb
|
79
78
|
- lib/mini_magick/image/info.rb
|
80
79
|
- lib/mini_magick/shell.rb
|
81
80
|
- lib/mini_magick/tool.rb
|
82
|
-
- lib/mini_magick/tool/animate.rb
|
83
|
-
- lib/mini_magick/tool/compare.rb
|
84
|
-
- lib/mini_magick/tool/composite.rb
|
85
|
-
- lib/mini_magick/tool/conjure.rb
|
86
|
-
- lib/mini_magick/tool/convert.rb
|
87
|
-
- lib/mini_magick/tool/display.rb
|
88
|
-
- lib/mini_magick/tool/identify.rb
|
89
|
-
- lib/mini_magick/tool/import.rb
|
90
|
-
- lib/mini_magick/tool/magick.rb
|
91
|
-
- lib/mini_magick/tool/mogrify.rb
|
92
|
-
- lib/mini_magick/tool/mogrify_restricted.rb
|
93
|
-
- lib/mini_magick/tool/montage.rb
|
94
|
-
- lib/mini_magick/tool/stream.rb
|
95
81
|
- lib/mini_magick/utilities.rb
|
96
82
|
- lib/mini_magick/version.rb
|
97
83
|
homepage: https://github.com/minimagick/minimagick
|
98
84
|
licenses:
|
99
85
|
- MIT
|
100
|
-
metadata:
|
86
|
+
metadata:
|
87
|
+
changelog_uri: https://github.com/minimagick/minimagick/releases
|
101
88
|
post_install_message:
|
102
89
|
rdoc_options: []
|
103
90
|
require_paths:
|
@@ -113,9 +100,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
100
|
- !ruby/object:Gem::Version
|
114
101
|
version: '0'
|
115
102
|
requirements:
|
116
|
-
- You must have ImageMagick
|
103
|
+
- You must have ImageMagick installed
|
117
104
|
rubygems_version: 3.5.11
|
118
105
|
signing_key:
|
119
106
|
specification_version: 4
|
120
|
-
summary: Manipulate images with minimal use of memory via ImageMagick
|
107
|
+
summary: Manipulate images with minimal use of memory via ImageMagick
|
121
108
|
test_files: []
|
data/lib/mini_gmagick.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require "mini_magick/tool/mogrify"
|
2
|
-
|
3
|
-
module MiniMagick
|
4
|
-
class Tool
|
5
|
-
##
|
6
|
-
# @see http://www.imagemagick.org/script/mogrify.php
|
7
|
-
#
|
8
|
-
class MogrifyRestricted < Mogrify
|
9
|
-
def format(*args)
|
10
|
-
fail NoMethodError,
|
11
|
-
"you must call #format on a MiniMagick::Image directly"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|