rmagick 2.14.0 → 2.15.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rmagick might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/.rubocop.yml +79 -45
- data/CODE_OF_CONDUCT.md +13 -0
- data/CONTRIBUTING.md +21 -3
- data/ChangeLog +6 -1
- data/Rakefile +6 -3
- data/ext/RMagick/extconf.rb +2 -1
- data/ext/RMagick/rmagick.c +11 -4
- data/ext/RMagick/rmagick.h +4 -0
- data/ext/RMagick/rmdraw.c +35 -11
- data/ext/RMagick/rmenum.c +13 -4
- data/ext/RMagick/rmfill.c +4 -1
- data/ext/RMagick/rmilist.c +44 -13
- data/ext/RMagick/rmimage.c +196 -59
- data/ext/RMagick/rminfo.c +33 -10
- data/ext/RMagick/rmmain.c +10 -3
- data/ext/RMagick/rmmontage.c +12 -4
- data/ext/RMagick/rmpixel.c +18 -5
- data/ext/RMagick/rmstruct.c +108 -31
- data/ext/RMagick/rmutil.c +48 -24
- data/lib/rmagick/version.rb +1 -1
- data/lib/rmagick_internal.rb +8 -5
- data/rmagick.gemspec +4 -3
- data/spec/rmagick/draw_spec.rb +156 -0
- data/spec/spec_helper.rb +1 -0
- data/test/Magick.rb +0 -1
- data/test/test_all_basic.rb +0 -1
- metadata +25 -7
- data/test/Draw.rb +0 -119
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: beb83114bca52271ffbe728210030f1fe165e0b3
|
4
|
+
data.tar.gz: aa899f36246d733532c30056f5a2c25a96e4e111
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b05b73eb4085af7f55727f85febbe437625c217380312828d06110767b67ee6108fd0bd74d6a0949b9eb93f759243048d25a84a8061d8892be0b698684d8fbd9
|
7
|
+
data.tar.gz: 430a64346546bf3f8efcbcada84b88f501b4db0713e7d44aafd6ec333152232d61d19eb07d1ef17b7f4163e9738c9d5cdb5d4912bfe9d31d692c76c3aa43ab16
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require spec_helper
|
data/.rubocop.yml
CHANGED
@@ -1,9 +1,22 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
# Custom configuration, edit with care! This gem needs to be backwards
|
2
|
+
# compatible with Ruby 1.8:
|
3
|
+
|
4
|
+
Style/HashSyntax:
|
5
|
+
EnforcedStyle: hash_rockets
|
6
|
+
|
7
|
+
Style/DeprecatedHashMethods:
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
# TODO: How to warn if stabby proc is used?
|
11
|
+
Style/Lambda:
|
12
|
+
Enabled: false
|
13
|
+
|
14
|
+
# Auto-generated config to be cleaned up and deleted:
|
15
|
+
|
16
|
+
# Offense count: 2
|
17
|
+
# Cop supports --auto-correct.
|
18
|
+
Lint/BlockAlignment:
|
19
|
+
Enabled: false
|
7
20
|
|
8
21
|
# Offense count: 1
|
9
22
|
Lint/HandleExceptions:
|
@@ -35,9 +48,9 @@ Lint/UnusedMethodArgument:
|
|
35
48
|
Lint/UselessAssignment:
|
36
49
|
Enabled: false
|
37
50
|
|
38
|
-
# Offense count:
|
51
|
+
# Offense count: 183
|
39
52
|
Metrics/AbcSize:
|
40
|
-
Max:
|
53
|
+
Max: 559
|
41
54
|
|
42
55
|
# Offense count: 1
|
43
56
|
Metrics/BlockNesting:
|
@@ -46,18 +59,18 @@ Metrics/BlockNesting:
|
|
46
59
|
# Offense count: 17
|
47
60
|
# Configuration parameters: CountComments.
|
48
61
|
Metrics/ClassLength:
|
49
|
-
Max:
|
62
|
+
Max: 1099
|
50
63
|
|
51
64
|
# Offense count: 22
|
52
65
|
Metrics/CyclomaticComplexity:
|
53
66
|
Max: 42
|
54
67
|
|
55
|
-
# Offense count:
|
68
|
+
# Offense count: 844
|
56
69
|
# Configuration parameters: AllowURI, URISchemes.
|
57
70
|
Metrics/LineLength:
|
58
|
-
Max:
|
71
|
+
Max: 276
|
59
72
|
|
60
|
-
# Offense count:
|
73
|
+
# Offense count: 178
|
61
74
|
# Configuration parameters: CountComments.
|
62
75
|
Metrics/MethodLength:
|
63
76
|
Max: 157
|
@@ -85,7 +98,12 @@ Style/BarePercentLiterals:
|
|
85
98
|
Style/CaseEquality:
|
86
99
|
Enabled: false
|
87
100
|
|
88
|
-
# Offense count:
|
101
|
+
# Offense count: 63
|
102
|
+
# Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep.
|
103
|
+
Style/CaseIndentation:
|
104
|
+
Enabled: false
|
105
|
+
|
106
|
+
# Offense count: 13
|
89
107
|
Style/ClassAndModuleCamelCase:
|
90
108
|
Enabled: false
|
91
109
|
|
@@ -94,23 +112,25 @@ Style/ClassAndModuleCamelCase:
|
|
94
112
|
Style/ClassAndModuleChildren:
|
95
113
|
Enabled: false
|
96
114
|
|
97
|
-
# Offense count:
|
98
|
-
|
115
|
+
# Offense count: 1
|
116
|
+
# Cop supports --auto-correct.
|
117
|
+
Style/ClosingParenthesisIndentation:
|
99
118
|
Enabled: false
|
100
119
|
|
101
|
-
# Offense count:
|
120
|
+
# Offense count: 5
|
102
121
|
# Cop supports --auto-correct.
|
103
|
-
Style/
|
122
|
+
Style/CommentIndentation:
|
104
123
|
Enabled: false
|
105
124
|
|
106
|
-
# Offense count:
|
107
|
-
Style/
|
125
|
+
# Offense count: 126
|
126
|
+
Style/ConstantName:
|
108
127
|
Enabled: false
|
109
128
|
|
110
|
-
|
111
|
-
|
129
|
+
# Offense count: 62
|
130
|
+
Style/Documentation:
|
131
|
+
Enabled: false
|
112
132
|
|
113
|
-
# Offense count:
|
133
|
+
# Offense count: 23
|
114
134
|
# Configuration parameters: Exclude.
|
115
135
|
Style/FileName:
|
116
136
|
Enabled: false
|
@@ -120,31 +140,35 @@ Style/FileName:
|
|
120
140
|
Style/FormatString:
|
121
141
|
Enabled: false
|
122
142
|
|
123
|
-
# Offense count:
|
143
|
+
# Offense count: 45
|
124
144
|
# Configuration parameters: AllowedVariables.
|
125
145
|
Style/GlobalVars:
|
126
146
|
Enabled: false
|
127
147
|
|
128
|
-
# Offense count:
|
148
|
+
# Offense count: 8
|
129
149
|
# Configuration parameters: MinBodyLength.
|
130
150
|
Style/GuardClause:
|
131
151
|
Enabled: false
|
132
152
|
|
153
|
+
# Offense count: 29
|
133
154
|
# Cop supports --auto-correct.
|
134
|
-
Style/HashSyntax:
|
135
|
-
EnforcedStyle: hash_rockets
|
136
|
-
|
137
|
-
# Offense count: 28
|
138
155
|
# Configuration parameters: MaxLineLength.
|
139
156
|
Style/IfUnlessModifier:
|
140
157
|
Enabled: false
|
141
158
|
|
142
|
-
# Offense count:
|
159
|
+
# Offense count: 651
|
143
160
|
# Cop supports --auto-correct.
|
144
|
-
|
161
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
162
|
+
Style/IndentationConsistency:
|
145
163
|
Enabled: false
|
146
164
|
|
147
|
-
# Offense count:
|
165
|
+
# Offense count: 1049
|
166
|
+
# Cop supports --auto-correct.
|
167
|
+
# Configuration parameters: Width.
|
168
|
+
Style/IndentationWidth:
|
169
|
+
Enabled: false
|
170
|
+
|
171
|
+
# Offense count: 47
|
148
172
|
# Cop supports --auto-correct.
|
149
173
|
Style/LeadingCommentSpace:
|
150
174
|
Enabled: false
|
@@ -154,8 +178,11 @@ Style/LeadingCommentSpace:
|
|
154
178
|
Style/MethodName:
|
155
179
|
Enabled: false
|
156
180
|
|
181
|
+
# Offense count: 9
|
182
|
+
# Cop supports --auto-correct.
|
183
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
157
184
|
Style/MultilineOperationIndentation:
|
158
|
-
|
185
|
+
Enabled: false
|
159
186
|
|
160
187
|
# Offense count: 1
|
161
188
|
Style/MultilineTernaryOperator:
|
@@ -175,7 +202,7 @@ Style/NumericLiterals:
|
|
175
202
|
Style/OpMethod:
|
176
203
|
Enabled: false
|
177
204
|
|
178
|
-
# Offense count:
|
205
|
+
# Offense count: 9
|
179
206
|
# Cop supports --auto-correct.
|
180
207
|
# Configuration parameters: PreferredDelimiters.
|
181
208
|
Style/PercentLiteralDelimiters:
|
@@ -191,8 +218,9 @@ Style/PerlBackrefs:
|
|
191
218
|
Style/PredicateName:
|
192
219
|
Enabled: false
|
193
220
|
|
194
|
-
# Offense count:
|
195
|
-
#
|
221
|
+
# Offense count: 1
|
222
|
+
# Cop supports --auto-correct.
|
223
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
|
196
224
|
Style/RegexpLiteral:
|
197
225
|
Enabled: false
|
198
226
|
|
@@ -200,6 +228,12 @@ Style/RegexpLiteral:
|
|
200
228
|
Style/RescueModifier:
|
201
229
|
Enabled: false
|
202
230
|
|
231
|
+
# Offense count: 2
|
232
|
+
# Cop supports --auto-correct.
|
233
|
+
# Configuration parameters: AllowAsExpressionSeparator.
|
234
|
+
Style/Semicolon:
|
235
|
+
Enabled: false
|
236
|
+
|
203
237
|
# Offense count: 2
|
204
238
|
# Configuration parameters: Methods.
|
205
239
|
Style/SingleLineBlockParams:
|
@@ -210,7 +244,7 @@ Style/SingleLineBlockParams:
|
|
210
244
|
Style/SingleSpaceBeforeFirstArg:
|
211
245
|
Enabled: false
|
212
246
|
|
213
|
-
# Offense count:
|
247
|
+
# Offense count: 1114
|
214
248
|
# Cop supports --auto-correct.
|
215
249
|
Style/SpaceAfterComma:
|
216
250
|
Enabled: false
|
@@ -221,18 +255,19 @@ Style/SpaceAfterComma:
|
|
221
255
|
Style/SpaceAroundEqualsInParameterDefault:
|
222
256
|
Enabled: false
|
223
257
|
|
224
|
-
# Offense count:
|
258
|
+
# Offense count: 1066
|
225
259
|
# Cop supports --auto-correct.
|
260
|
+
# Configuration parameters: MultiSpaceAllowedForOperators.
|
226
261
|
Style/SpaceAroundOperators:
|
227
262
|
Enabled: false
|
228
263
|
|
229
|
-
# Offense count:
|
264
|
+
# Offense count: 3
|
230
265
|
# Cop supports --auto-correct.
|
231
266
|
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
232
267
|
Style/SpaceBeforeBlockBraces:
|
233
268
|
Enabled: false
|
234
269
|
|
235
|
-
# Offense count:
|
270
|
+
# Offense count: 204
|
236
271
|
# Cop supports --auto-correct.
|
237
272
|
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
|
238
273
|
Style/SpaceInsideBlockBraces:
|
@@ -251,15 +286,9 @@ Style/SpaceInsideHashLiteralBraces:
|
|
251
286
|
|
252
287
|
# Offense count: 35
|
253
288
|
# Cop supports --auto-correct.
|
254
|
-
# Many method calls in consecutive lines in RMagick have parameters aligned vertically.
|
255
|
-
# Therefore this cop should better be disabled.
|
256
|
-
# But you can delete this rule temporarily, run `rubocop -a`, and commit good fixes only.
|
257
289
|
Style/SpaceInsideParens:
|
258
290
|
Enabled: false
|
259
291
|
|
260
|
-
Style/StringLiterals:
|
261
|
-
EnforcedStyle: single_quotes
|
262
|
-
|
263
292
|
# Offense count: 12
|
264
293
|
# Cop supports --auto-correct.
|
265
294
|
# Configuration parameters: IgnoredMethods.
|
@@ -272,6 +301,11 @@ Style/SymbolProc:
|
|
272
301
|
Style/TrailingComma:
|
273
302
|
Enabled: false
|
274
303
|
|
304
|
+
# Offense count: 204
|
305
|
+
# Cop supports --auto-correct.
|
306
|
+
Style/TrailingWhitespace:
|
307
|
+
Enabled: false
|
308
|
+
|
275
309
|
# Offense count: 2
|
276
310
|
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
277
311
|
Style/VariableName:
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
*This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)*
|
data/CONTRIBUTING.md
CHANGED
@@ -4,7 +4,9 @@ RMagick Contributor's Guide
|
|
4
4
|
Welcome
|
5
5
|
-------
|
6
6
|
|
7
|
-
Thank you for considering contributing to RMagick. Your contribution is always welcome!
|
7
|
+
Thank you for considering contributing to RMagick. Your contribution is always welcome and appreciated!
|
8
|
+
|
9
|
+
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
|
8
10
|
|
9
11
|
|
10
12
|
Background
|
@@ -18,5 +20,21 @@ RMagick is a Ruby gem with a C extension. The extension wraps the ImageMagick C
|
|
18
20
|
Priorities
|
19
21
|
----------
|
20
22
|
|
21
|
-
|
22
|
-
|
23
|
+
1. Green build of the gem on all operating systems. You can see the current build state on [the project page at Travis CI](https://travis-ci.org/gemhome/rmagick). You are welcome to improve it.
|
24
|
+
2. [Open issues](https://github.com/gemhome/rmagick/issues). You are welcome to reproduce them, report current state, suggest solutions, open pull requests with fixes. If you don't know where to start, sort issues by least recently updated. You can also [subscribe to receive random issues by email](http://www.codetriage.com/gemhome/rmagick).
|
25
|
+
|
26
|
+
|
27
|
+
Testing
|
28
|
+
-------
|
29
|
+
|
30
|
+
Our goal is to migrate to [RSpec](http://rspec.info).
|
31
|
+
|
32
|
+
If you write new tests, please do it in RSpec.
|
33
|
+
|
34
|
+
You are also welcome to convert existing Test/Unit tests to RSpec.
|
35
|
+
|
36
|
+
|
37
|
+
Committing
|
38
|
+
----------
|
39
|
+
|
40
|
+
It is better if you follow [Git Style Guide](https://github.com/agis-/git-style-guide).
|
data/ChangeLog
CHANGED
@@ -1,4 +1,9 @@
|
|
1
|
-
|
1
|
+
RMagick 2.15.0
|
2
|
+
o Ability to remove alpha channel - @ollie
|
3
|
+
o C local variables guarded against GC to avoid segfaults - @u338steven
|
4
|
+
o trace_proc protected with a mutex to avoid segfaults - @u338steven
|
5
|
+
|
6
|
+
RMagick 2.14.0
|
2
7
|
o RMagick.rb moved to deprecated directory - @mockdeep
|
3
8
|
o Better ImageMagick feature detection - @bf4
|
4
9
|
o Prevent compilation failures if prefix is an empty string - @voxik
|
data/Rakefile
CHANGED
@@ -21,7 +21,7 @@ task :config do
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
desc 'abort when repo
|
24
|
+
desc 'abort when repo is not clean or has uncommited code'
|
25
25
|
task :assert_clean_repo do
|
26
26
|
sh('git diff --exit-code')
|
27
27
|
abort 'Git repo not clean' unless $CHILD_STATUS.success?
|
@@ -165,6 +165,8 @@ end
|
|
165
165
|
|
166
166
|
require 'rake/extensiontask'
|
167
167
|
require 'rake/testtask'
|
168
|
+
require 'rspec/core/rake_task'
|
169
|
+
RSpec::Core::RakeTask.new(:spec)
|
168
170
|
|
169
171
|
Rake::ExtensionTask.new('RMagick2') do |ext|
|
170
172
|
ext.ext_dir = 'ext/RMagick'
|
@@ -175,11 +177,12 @@ Rake::TestTask.new(:test) do |t|
|
|
175
177
|
end
|
176
178
|
|
177
179
|
task :test => :compile
|
180
|
+
task :spec => :compile
|
178
181
|
|
179
182
|
if ENV['STYLE_CHECKS']
|
180
183
|
require 'rubocop/rake_task'
|
181
184
|
RuboCop::RakeTask.new
|
182
|
-
task :default => [:test, :rubocop]
|
185
|
+
task :default => [:spec, :test, :rubocop]
|
183
186
|
else
|
184
|
-
task :default => :test
|
187
|
+
task :default => [:spec, :test]
|
185
188
|
end
|
data/ext/RMagick/extconf.rb
CHANGED
@@ -357,7 +357,8 @@ SRC
|
|
357
357
|
#check_sizeof("Image *", headers)
|
358
358
|
|
359
359
|
have_enum_values('AlphaChannelType', ['CopyAlphaChannel', # 6.4.3-7
|
360
|
-
'BackgroundAlphaChannel'
|
360
|
+
'BackgroundAlphaChannel', # 6.5.2-5
|
361
|
+
'RemoveAlphaChannel'], headers) # 6.7.5-1
|
361
362
|
have_enum_values('CompositeOperator', ['BlurCompositeOp', # 6.5.3-7
|
362
363
|
'DistortCompositeOp', # 6.5.3-10
|
363
364
|
'LinearBurnCompositeOp', # 6.5.4-3
|
data/ext/RMagick/rmagick.c
CHANGED
@@ -34,7 +34,7 @@ Magick_colors(VALUE class)
|
|
34
34
|
{
|
35
35
|
const ColorInfo **color_info_list;
|
36
36
|
size_t number_colors, x;
|
37
|
-
|
37
|
+
VALUE ary;
|
38
38
|
ExceptionInfo *exception;
|
39
39
|
|
40
40
|
exception = AcquireExceptionInfo();
|
@@ -62,6 +62,7 @@ Magick_colors(VALUE class)
|
|
62
62
|
}
|
63
63
|
|
64
64
|
magick_free((void *)color_info_list);
|
65
|
+
RB_GC_GUARD(ary);
|
65
66
|
return ary;
|
66
67
|
}
|
67
68
|
}
|
@@ -83,7 +84,7 @@ Magick_fonts(VALUE class)
|
|
83
84
|
{
|
84
85
|
const TypeInfo **type_info;
|
85
86
|
size_t number_types, x;
|
86
|
-
|
87
|
+
VALUE ary;
|
87
88
|
ExceptionInfo *exception;
|
88
89
|
|
89
90
|
exception = AcquireExceptionInfo();
|
@@ -108,6 +109,7 @@ Magick_fonts(VALUE class)
|
|
108
109
|
(void) rb_ary_push(ary, Import_TypeInfo((const TypeInfo *)type_info[x]));
|
109
110
|
}
|
110
111
|
magick_free((void *)type_info);
|
112
|
+
RB_GC_GUARD(ary);
|
111
113
|
return ary;
|
112
114
|
}
|
113
115
|
|
@@ -167,7 +169,7 @@ Magick_init_formats(VALUE class)
|
|
167
169
|
{
|
168
170
|
const MagickInfo **magick_info;
|
169
171
|
size_t number_formats, x;
|
170
|
-
|
172
|
+
VALUE formats;
|
171
173
|
ExceptionInfo *exception;
|
172
174
|
|
173
175
|
class = class; // defeat "never referenced" message from icc
|
@@ -186,6 +188,7 @@ Magick_init_formats(VALUE class)
|
|
186
188
|
, rb_str_new2(magick_info[x]->name)
|
187
189
|
, MagickInfo_to_format((const MagickInfo *)magick_info[x]));
|
188
190
|
}
|
191
|
+
RB_GC_GUARD(formats);
|
189
192
|
return formats;
|
190
193
|
}
|
191
194
|
|
@@ -206,7 +209,7 @@ Magick_init_formats(VALUE class)
|
|
206
209
|
VALUE
|
207
210
|
Magick_limit_resource(int argc, VALUE *argv, VALUE class)
|
208
211
|
{
|
209
|
-
|
212
|
+
VALUE resource, limit;
|
210
213
|
ResourceType res = UndefinedResource;
|
211
214
|
char *str;
|
212
215
|
ID id;
|
@@ -280,6 +283,8 @@ Magick_limit_resource(int argc, VALUE *argv, VALUE class)
|
|
280
283
|
break;
|
281
284
|
}
|
282
285
|
|
286
|
+
RB_GC_GUARD(resource);
|
287
|
+
|
283
288
|
cur_limit = GetMagickResourceLimit(res);
|
284
289
|
|
285
290
|
if (argc > 1)
|
@@ -287,6 +292,8 @@ Magick_limit_resource(int argc, VALUE *argv, VALUE class)
|
|
287
292
|
(void) SetMagickResourceLimit(res, (MagickSizeType)NUM2ULONG(limit));
|
288
293
|
}
|
289
294
|
|
295
|
+
RB_GC_GUARD(limit);
|
296
|
+
|
290
297
|
return ULONG2NUM(cur_limit);
|
291
298
|
}
|
292
299
|
|