rmagick 4.1.2 → 4.2.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/.github/workflows/ci.yml +15 -48
- data/.rubocop_todo.yml +114 -70
- data/CHANGELOG.md +14 -0
- data/CODE_OF_CONDUCT.md +122 -7
- data/README.md +16 -8
- data/before_install_linux.sh +1 -1
- data/before_install_osx.sh +2 -2
- data/ext/RMagick/extconf.rb +4 -1
- data/ext/RMagick/rmagick.h +3 -0
- data/ext/RMagick/rmdraw.c +31 -5
- data/ext/RMagick/rmfill.c +4 -1
- data/ext/RMagick/rmilist.c +9 -1
- data/ext/RMagick/rmimage.c +5 -2
- data/ext/RMagick/rminfo.c +10 -2
- data/ext/RMagick/rmmain.c +14 -1
- data/ext/RMagick/rmutil.c +36 -8
- data/lib/rmagick/version.rb +1 -1
- data/rmagick.gemspec +3 -2
- metadata +21 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 260708d7b56c2e75a8a67393fc27c96897fd58c473f46c57c1febec5816200e9
|
4
|
+
data.tar.gz: b5b17d6e606f44be1d09986e58988eaad715f2879570a3c16016ff6261cb5bd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1809116920cca2eb49f10412879badd216e2e00819796f4f7fb7d1ebd04792a206363f70d42893d2277260ec2fda028c66c7e33027c4ec6d5591c8826e6114b8
|
7
|
+
data.tar.gz: 9e0edf4cc0afd66eeba825feb37a233e02365daec3737561ab8f101fe7b781953e9bfbe811a88823b66974db6e9a9d1bd1f70175b581b1ddc9691167e2c23a16
|
data/.github/workflows/ci.yml
CHANGED
@@ -3,10 +3,10 @@ name: CI
|
|
3
3
|
on:
|
4
4
|
push:
|
5
5
|
branches:
|
6
|
-
-
|
6
|
+
- main
|
7
7
|
pull_request:
|
8
8
|
branches:
|
9
|
-
-
|
9
|
+
- main
|
10
10
|
|
11
11
|
jobs:
|
12
12
|
lint:
|
@@ -17,14 +17,7 @@ jobs:
|
|
17
17
|
- name: Set up Ruby 2.3
|
18
18
|
uses: ruby/setup-ruby@master
|
19
19
|
with:
|
20
|
-
ruby-version: 2.3
|
21
|
-
- name: Cache Ruby dependencies
|
22
|
-
uses: actions/cache@v1
|
23
|
-
with:
|
24
|
-
path: ./vendor/bundle
|
25
|
-
key: v1-linux-2.3-${{ hashFiles('rmagick.gemspec') }}
|
26
|
-
restore-keys: |
|
27
|
-
v1-linux-2.3-${{ hashFiles('rmagick.gemspec') }}
|
20
|
+
ruby-version: '2.3'
|
28
21
|
- name: Build and test with Rake
|
29
22
|
run: |
|
30
23
|
bundle install --path=vendor/bundle --jobs 4 --retry 3
|
@@ -35,23 +28,16 @@ jobs:
|
|
35
28
|
timeout-minutes: 10
|
36
29
|
strategy:
|
37
30
|
matrix:
|
38
|
-
ruby-version: [2.3, 2.4, 2.5, 2.6, 2.7]
|
31
|
+
ruby-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0']
|
39
32
|
imagemagick-version:
|
40
33
|
- { full: 6.7.7-10, major-minor: '6.7' }
|
41
34
|
- { full: 6.8.9-10, major-minor: '6.8' }
|
42
|
-
- { full: 6.9.11-
|
43
|
-
- { full: 7.0.10-
|
35
|
+
- { full: 6.9.11-58, major-minor: '6.9' }
|
36
|
+
- { full: 7.0.10-58, major-minor: '7.0' }
|
44
37
|
|
45
38
|
name: Linux, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
|
46
39
|
steps:
|
47
40
|
- uses: actions/checkout@v2
|
48
|
-
- name: Cache ImageMagick
|
49
|
-
uses: actions/cache@v1
|
50
|
-
with:
|
51
|
-
path: ./build-ImageMagick
|
52
|
-
key: v1-linux-imagemagick-${{ matrix.imagemagick-version.full }}
|
53
|
-
restore-keys: |
|
54
|
-
v1-linux-imagemagick-${{ matrix.imagemagick-version.full }}
|
55
41
|
- name: Set up Ruby ${{ matrix.ruby-version }}
|
56
42
|
uses: ruby/setup-ruby@master
|
57
43
|
with:
|
@@ -60,13 +46,6 @@ jobs:
|
|
60
46
|
run: |
|
61
47
|
export IMAGEMAGICK_VERSION=${{ matrix.imagemagick-version.full }}
|
62
48
|
./before_install_linux.sh
|
63
|
-
- name: Cache Ruby dependencies
|
64
|
-
uses: actions/cache@v1
|
65
|
-
with:
|
66
|
-
path: ./vendor/bundle
|
67
|
-
key: v1-linux-${{ matrix.ruby-version }}-${{ hashFiles('rmagick.gemspec') }}
|
68
|
-
restore-keys: |
|
69
|
-
v1-linux-${{ matrix.ruby-version }}-${{ hashFiles('rmagick.gemspec') }}
|
70
49
|
- name: Build and test with Rake
|
71
50
|
run: |
|
72
51
|
bundle install --path=vendor/bundle --jobs 4 --retry 3
|
@@ -74,23 +53,17 @@ jobs:
|
|
74
53
|
|
75
54
|
test-macos:
|
76
55
|
runs-on: macos-latest
|
56
|
+
timeout-minutes: 20
|
77
57
|
strategy:
|
78
58
|
matrix:
|
79
|
-
ruby-version: [2.6, 2.7]
|
59
|
+
ruby-version: ['2.6', '2.7', '3.0']
|
80
60
|
imagemagick-version:
|
81
|
-
- { full: 6.9.11-
|
82
|
-
- { full: 7.0.10-
|
61
|
+
- { full: 6.9.11-58, major-minor: '6.9' }
|
62
|
+
- { full: 7.0.10-58, major-minor: '7.0' }
|
83
63
|
|
84
64
|
name: macOS, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
|
85
65
|
steps:
|
86
66
|
- uses: actions/checkout@v2
|
87
|
-
- name: Cache ImageMagick
|
88
|
-
uses: actions/cache@v1
|
89
|
-
with:
|
90
|
-
path: ./build-ImageMagick
|
91
|
-
key: v1-macos-imagemagick-${{ matrix.imagemagick-version.full }}
|
92
|
-
restore-keys: |
|
93
|
-
v1-macos-imagemagick-${{ matrix.imagemagick-version.full }}
|
94
67
|
- name: Set up Ruby ${{ matrix.ruby-version }}
|
95
68
|
uses: ruby/setup-ruby@master
|
96
69
|
with:
|
@@ -98,13 +71,6 @@ jobs:
|
|
98
71
|
- name: Update/Install packages
|
99
72
|
run: |
|
100
73
|
IMAGEMAGICK_VERSION=${{ matrix.imagemagick-version.full }} ./before_install_osx.sh
|
101
|
-
- name: Cache Ruby dependencies
|
102
|
-
uses: actions/cache@v1
|
103
|
-
with:
|
104
|
-
path: ./vendor/bundle
|
105
|
-
key: v1-macos-${{ matrix.ruby-version }}-${{ hashFiles('rmagick.gemspec') }}
|
106
|
-
restore-keys: |
|
107
|
-
v1-macos-${{ matrix.ruby-version }}-${{ hashFiles('rmagick.gemspec') }}
|
108
74
|
- name: Build and test with Rake
|
109
75
|
run: |
|
110
76
|
bundle install --path=vendor/bundle --jobs 4 --retry 3
|
@@ -115,11 +81,11 @@ jobs:
|
|
115
81
|
timeout-minutes: 10
|
116
82
|
strategy:
|
117
83
|
matrix:
|
118
|
-
ruby-version: [2.3, 2.4, 2.5, 2.6, 2.7]
|
84
|
+
ruby-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0']
|
119
85
|
imagemagick-version:
|
120
86
|
- { full: 6.8.9-10, major-minor: '6.8' }
|
121
|
-
- { full: 6.9.11-
|
122
|
-
- { full: 7.0.10-
|
87
|
+
- { full: 6.9.11-29, major-minor: '6.9' } # seems that binary file mirroring have stopped.
|
88
|
+
- { full: 7.0.10-29, major-minor: '7.0' } # seems that binary file mirroring have stopped.
|
123
89
|
name: MSWin, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
|
124
90
|
steps:
|
125
91
|
- uses: actions/checkout@v2
|
@@ -133,7 +99,8 @@ jobs:
|
|
133
99
|
$imagemagick_version_without_patch = $imagemagick_version.split("-")[0]
|
134
100
|
$installer_name = "ImageMagick-$($imagemagick_version)-Q16-x64-dll.exe"
|
135
101
|
$url = "https://ftp.icm.edu.pl/pub/graphics/ImageMagick/binaries/$($installer_name)"
|
136
|
-
choco install wget
|
102
|
+
choco install wget
|
103
|
+
choco install ghostscript -Version 9.50
|
137
104
|
wget $url --progress=dot
|
138
105
|
cmd.exe /D /S /C "$($installer_name) /DIR=D:\ImageMagick /VERYSILENT /TASKS=install_Devel"
|
139
106
|
- name: Build and test with Rake
|
data/.rubocop_todo.yml
CHANGED
@@ -1,11 +1,19 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2020-
|
3
|
+
# on 2020-10-10 21:34:21 +0900 using RuboCop version 0.81.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
+
# Offense count: 1
|
10
|
+
# Cop supports --auto-correct.
|
11
|
+
# Configuration parameters: TreatCommentsAsGroupSeparators, Include.
|
12
|
+
# Include: **/*.gemspec
|
13
|
+
Gemspec/OrderedDependencies:
|
14
|
+
Exclude:
|
15
|
+
- 'rmagick.gemspec'
|
16
|
+
|
9
17
|
# Offense count: 12
|
10
18
|
# Cop supports --auto-correct.
|
11
19
|
# Configuration parameters: Categories, ExpectedOrder.
|
@@ -49,16 +57,20 @@ Layout/MultilineMethodArgumentLineBreaks:
|
|
49
57
|
- 'lib/rmagick_internal.rb'
|
50
58
|
|
51
59
|
# Offense count: 1
|
52
|
-
|
60
|
+
# Cop supports --auto-correct.
|
61
|
+
# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
|
62
|
+
# SupportedStylesForExponentOperator: space, no_space
|
63
|
+
Layout/SpaceAroundOperators:
|
53
64
|
Exclude:
|
54
|
-
- '
|
65
|
+
- 'rmagick.gemspec'
|
55
66
|
|
56
|
-
# Offense count:
|
57
|
-
Lint/
|
67
|
+
# Offense count: 1
|
68
|
+
Lint/EmptyWhen:
|
58
69
|
Exclude:
|
59
|
-
- 'lib/
|
70
|
+
- 'lib/rvg/misc.rb'
|
60
71
|
|
61
72
|
# Offense count: 94
|
73
|
+
# Cop supports --auto-correct.
|
62
74
|
Lint/NumberConversion:
|
63
75
|
Exclude:
|
64
76
|
- 'doc/ex/get_pixels.rb'
|
@@ -74,21 +86,34 @@ Lint/NumberConversion:
|
|
74
86
|
- 'spec/rmagick/enum/to_i_spec.rb'
|
75
87
|
- 'spec/rmagick/image/export_pixels_spec.rb'
|
76
88
|
|
89
|
+
# Offense count: 2
|
90
|
+
# Cop supports --auto-correct.
|
91
|
+
Lint/RedundantStringCoercion:
|
92
|
+
Exclude:
|
93
|
+
- 'spec/rmagick/font/initialize_spec.rb'
|
94
|
+
|
77
95
|
# Offense count: 1
|
78
96
|
Lint/RescueException:
|
79
97
|
Exclude:
|
80
98
|
- 'lib/rmagick_internal.rb'
|
81
99
|
|
100
|
+
# Offense count: 1
|
101
|
+
# Configuration parameters: AllowComments.
|
102
|
+
Lint/SuppressedException:
|
103
|
+
Exclude:
|
104
|
+
- 'lib/rmagick_internal.rb'
|
105
|
+
|
82
106
|
# Offense count: 1
|
83
107
|
Lint/UselessComparison:
|
84
108
|
Exclude:
|
85
109
|
- 'spec/rmagick/enum/case_equality_spec.rb'
|
86
110
|
|
87
|
-
# Offense count:
|
111
|
+
# Offense count: 45
|
112
|
+
# Configuration parameters: IgnoredMethods.
|
88
113
|
Metrics/AbcSize:
|
89
114
|
Max: 537
|
90
115
|
|
91
|
-
# Offense count:
|
116
|
+
# Offense count: 77
|
92
117
|
# Configuration parameters: CountComments, ExcludedMethods.
|
93
118
|
# ExcludedMethods: refine
|
94
119
|
Metrics/BlockLength:
|
@@ -102,13 +127,14 @@ Metrics/BlockNesting:
|
|
102
127
|
# Offense count: 9
|
103
128
|
# Configuration parameters: CountComments.
|
104
129
|
Metrics/ClassLength:
|
105
|
-
Max:
|
130
|
+
Max: 460
|
106
131
|
|
107
132
|
# Offense count: 21
|
133
|
+
# Configuration parameters: IgnoredMethods.
|
108
134
|
Metrics/CyclomaticComplexity:
|
109
135
|
Max: 42
|
110
136
|
|
111
|
-
# Offense count:
|
137
|
+
# Offense count: 55
|
112
138
|
# Configuration parameters: CountComments, ExcludedMethods.
|
113
139
|
Metrics/MethodLength:
|
114
140
|
Max: 146
|
@@ -119,6 +145,7 @@ Metrics/ParameterLists:
|
|
119
145
|
Max: 8
|
120
146
|
|
121
147
|
# Offense count: 15
|
148
|
+
# Configuration parameters: IgnoredMethods.
|
122
149
|
Metrics/PerceivedComplexity:
|
123
150
|
Max: 40
|
124
151
|
|
@@ -169,62 +196,29 @@ Naming/FileName:
|
|
169
196
|
- 'doc/ex/quantize-m.rb'
|
170
197
|
|
171
198
|
# Offense count: 4
|
172
|
-
# Configuration parameters: EnforcedStyle.
|
199
|
+
# Configuration parameters: EnforcedStyle, IgnoredPatterns.
|
173
200
|
# SupportedStyles: snake_case, camelCase
|
174
201
|
Naming/MethodName:
|
175
202
|
Exclude:
|
176
203
|
- 'lib/rvg/misc.rb'
|
177
204
|
- 'lib/rvg/transformable.rb'
|
178
205
|
|
179
|
-
# Offense count:
|
206
|
+
# Offense count: 222
|
180
207
|
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
181
|
-
# AllowedNames: io, id, to, by, on, in, at, ip, db
|
182
|
-
Naming/
|
208
|
+
# AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp
|
209
|
+
Naming/MethodParameterName:
|
183
210
|
Enabled: false
|
184
211
|
|
185
|
-
# Offense count:
|
212
|
+
# Offense count: 421
|
186
213
|
# Configuration parameters: Max.
|
187
214
|
RSpec/ExampleLength:
|
188
215
|
Enabled: false
|
189
216
|
|
190
|
-
# Offense count:
|
217
|
+
# Offense count: 539
|
191
218
|
# Configuration parameters: AggregateFailuresByDefault.
|
192
219
|
RSpec/MultipleExpectations:
|
193
220
|
Max: 72
|
194
221
|
|
195
|
-
# Offense count: 5
|
196
|
-
RSpec/Pending:
|
197
|
-
Exclude:
|
198
|
-
- 'spec/rmagick/draw/marshal_dump_spec.rb'
|
199
|
-
- 'spec/rmagick/image/changed_predicate_spec.rb'
|
200
|
-
- 'spec/rmagick/image/liquid_rescale_spec.rb'
|
201
|
-
- 'spec/rmagick/image/read_spec.rb'
|
202
|
-
|
203
|
-
# Offense count: 2
|
204
|
-
# Configuration parameters: EnforcedStyle.
|
205
|
-
# SupportedStyles: strict, flexible
|
206
|
-
Rails/Date:
|
207
|
-
Exclude:
|
208
|
-
- 'doc/ex/polaroid.rb'
|
209
|
-
- 'rmagick.gemspec'
|
210
|
-
|
211
|
-
# Offense count: 7
|
212
|
-
# Configuration parameters: Include.
|
213
|
-
# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb
|
214
|
-
Rails/Output:
|
215
|
-
Exclude:
|
216
|
-
- 'lib/rvg/deep_equal.rb'
|
217
|
-
- 'lib/rvg/rvg.rb'
|
218
|
-
|
219
|
-
# Offense count: 3
|
220
|
-
# Cop supports --auto-correct.
|
221
|
-
# Configuration parameters: EnforcedStyle.
|
222
|
-
# SupportedStyles: strict, flexible
|
223
|
-
Rails/TimeZone:
|
224
|
-
Exclude:
|
225
|
-
- 'Rakefile'
|
226
|
-
- 'ext/RMagick/extconf.rb'
|
227
|
-
|
228
222
|
# Offense count: 4
|
229
223
|
Security/MarshalLoad:
|
230
224
|
Exclude:
|
@@ -249,62 +243,105 @@ Style/CaseEquality:
|
|
249
243
|
Style/CommentedKeyword:
|
250
244
|
Enabled: false
|
251
245
|
|
252
|
-
# Offense count:
|
246
|
+
# Offense count: 126
|
253
247
|
Style/ConstantVisibility:
|
254
248
|
Exclude:
|
249
|
+
- 'examples/histogram.rb'
|
250
|
+
- 'ext/RMagick/extconf.rb'
|
251
|
+
- 'lib/rmagick/version.rb'
|
255
252
|
- 'lib/rmagick_internal.rb'
|
253
|
+
- 'lib/rvg/misc.rb'
|
254
|
+
- 'lib/rvg/rvg.rb'
|
255
|
+
- 'lib/rvg/stylable.rb'
|
256
|
+
- 'spec/support/helpers.rb'
|
256
257
|
|
257
|
-
# Offense count:
|
258
|
+
# Offense count: 809
|
258
259
|
# Cop supports --auto-correct.
|
259
260
|
# Configuration parameters: Notice, AutocorrectNotice.
|
260
261
|
Style/Copyright:
|
261
262
|
Enabled: false
|
262
263
|
|
263
|
-
# Offense count:
|
264
|
+
# Offense count: 37
|
264
265
|
Style/Documentation:
|
265
266
|
Enabled: false
|
266
267
|
|
267
|
-
# Offense count:
|
268
|
+
# Offense count: 72
|
268
269
|
# Configuration parameters: RequireForNonPublicMethods.
|
269
270
|
Style/DocumentationMethod:
|
270
|
-
|
271
|
+
Exclude:
|
272
|
+
- 'spec/**/*'
|
273
|
+
- 'test/**/*'
|
274
|
+
- 'Rakefile'
|
275
|
+
- 'doc/ex/ViewBox.rb'
|
276
|
+
- 'doc/ex/sparse_color.rb'
|
277
|
+
- 'examples/histogram.rb'
|
278
|
+
- 'examples/pattern_fill.rb'
|
279
|
+
- 'ext/RMagick/extconf.rb'
|
280
|
+
- 'lib/rmagick_internal.rb'
|
281
|
+
- 'lib/rvg/container.rb'
|
282
|
+
- 'lib/rvg/deep_equal.rb'
|
283
|
+
- 'lib/rvg/embellishable.rb'
|
284
|
+
- 'lib/rvg/misc.rb'
|
285
|
+
- 'lib/rvg/stylable.rb'
|
286
|
+
- 'lib/rvg/transformable.rb'
|
287
|
+
- 'lib/rvg/units.rb'
|
271
288
|
|
272
|
-
# Offense count:
|
289
|
+
# Offense count: 208
|
273
290
|
# Configuration parameters: EnforcedStyle.
|
274
291
|
# SupportedStyles: annotated, template, unannotated
|
275
292
|
Style/FormatStringToken:
|
276
293
|
Exclude:
|
294
|
+
- 'doc/ex/colors.rb'
|
295
|
+
- 'doc/ex/fonts.rb'
|
296
|
+
- 'doc/ex/implode.rb'
|
297
|
+
- 'doc/ex/stegano.rb'
|
277
298
|
- 'examples/identify.rb'
|
278
|
-
- 'ext/RMagick/extconf.rb'
|
279
299
|
- 'lib/rmagick_internal.rb'
|
280
300
|
- 'lib/rvg/pathdata.rb'
|
281
301
|
|
282
|
-
# Offense count:
|
302
|
+
# Offense count: 808
|
283
303
|
# Cop supports --auto-correct.
|
284
304
|
# Configuration parameters: EnforcedStyle.
|
285
|
-
# SupportedStyles:
|
305
|
+
# SupportedStyles: always, always_true, never
|
286
306
|
Style/FrozenStringLiteralComment:
|
287
307
|
Enabled: false
|
288
308
|
|
289
|
-
# Offense count:
|
309
|
+
# Offense count: 42
|
290
310
|
# Configuration parameters: AllowedVariables.
|
291
311
|
Style/GlobalVars:
|
292
312
|
Exclude:
|
293
313
|
- 'ext/RMagick/extconf.rb'
|
294
314
|
|
295
|
-
# Offense count:
|
315
|
+
# Offense count: 12
|
316
|
+
# Cop supports --auto-correct.
|
317
|
+
Style/HashEachMethods:
|
318
|
+
Exclude:
|
319
|
+
- 'doc/ex/preview.rb'
|
320
|
+
- 'spec/rmagick/image/auto_orient_spec.rb'
|
321
|
+
- 'spec/rmagick/image/channel_spec.rb'
|
322
|
+
- 'spec/rmagick/image/colorspace_spec.rb'
|
323
|
+
- 'spec/rmagick/image/info/colorspace_spec.rb'
|
324
|
+
- 'spec/rmagick/image/info/compression_spec.rb'
|
325
|
+
- 'spec/rmagick/image/info/dispose_spec.rb'
|
326
|
+
- 'spec/rmagick/image/info/gravity_spec.rb'
|
327
|
+
- 'spec/rmagick/image/info/image_type_spec.rb'
|
328
|
+
- 'spec/rmagick/image/info/interlace_spec.rb'
|
329
|
+
- 'spec/rmagick/image/info/orientation_spec.rb'
|
330
|
+
- 'spec/rmagick/image/info/units_spec.rb'
|
331
|
+
|
332
|
+
# Offense count: 6
|
296
333
|
# Cop supports --auto-correct.
|
297
334
|
Style/IfUnlessModifier:
|
298
335
|
Exclude:
|
299
336
|
- 'ext/RMagick/extconf.rb'
|
300
337
|
|
301
|
-
# Offense count:
|
338
|
+
# Offense count: 148
|
302
339
|
Style/InlineComment:
|
303
340
|
Enabled: false
|
304
341
|
|
305
|
-
# Offense count:
|
342
|
+
# Offense count: 4804
|
306
343
|
# Cop supports --auto-correct.
|
307
|
-
# Configuration parameters: IgnoreMacros, IgnoredMethods, IncludedMacros, AllowParenthesesInMultilineCall, AllowParenthesesInChaining, AllowParenthesesInCamelCaseMethod, EnforcedStyle.
|
344
|
+
# Configuration parameters: IgnoreMacros, IgnoredMethods, IgnoredPatterns, IncludedMacros, AllowParenthesesInMultilineCall, AllowParenthesesInChaining, AllowParenthesesInCamelCaseMethod, EnforcedStyle.
|
308
345
|
# SupportedStyles: require_parentheses, omit_parentheses
|
309
346
|
Style/MethodCallWithArgsParentheses:
|
310
347
|
Enabled: false
|
@@ -343,7 +380,7 @@ Style/MixinUsage:
|
|
343
380
|
- 'examples/thumbnail.rb'
|
344
381
|
- 'examples/vignette.rb'
|
345
382
|
|
346
|
-
# Offense count:
|
383
|
+
# Offense count: 152
|
347
384
|
# Cop supports --auto-correct.
|
348
385
|
# Configuration parameters: EnforcedStyle.
|
349
386
|
# SupportedStyles: literals, strict
|
@@ -360,10 +397,17 @@ Style/NumericPredicate:
|
|
360
397
|
- 'lib/rmagick_internal.rb'
|
361
398
|
- 'lib/rvg/embellishable.rb'
|
362
399
|
|
400
|
+
# Offense count: 1
|
401
|
+
# Cop supports --auto-correct.
|
402
|
+
# Configuration parameters: AllowMultipleReturnValues.
|
403
|
+
Style/RedundantReturn:
|
404
|
+
Exclude:
|
405
|
+
- 'examples/histogram.rb'
|
406
|
+
|
363
407
|
# Offense count: 3
|
364
408
|
# Cop supports --auto-correct.
|
365
|
-
# Configuration parameters: ConvertCodeThatCanStartToReturnNil,
|
366
|
-
#
|
409
|
+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
|
410
|
+
# AllowedMethods: present?, blank?, presence, try, try!
|
367
411
|
Style/SafeNavigation:
|
368
412
|
Exclude:
|
369
413
|
- 'lib/rmagick_internal.rb'
|
@@ -390,16 +434,16 @@ Style/StringHashKeys:
|
|
390
434
|
- 'lib/rvg/misc.rb'
|
391
435
|
- 'spec/rmagick/image/properties_spec.rb'
|
392
436
|
|
393
|
-
# Offense count:
|
437
|
+
# Offense count: 226
|
394
438
|
# Cop supports --auto-correct.
|
395
439
|
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
396
440
|
# SupportedStyles: single_quotes, double_quotes
|
397
441
|
Style/StringLiterals:
|
398
442
|
Enabled: false
|
399
443
|
|
400
|
-
# Offense count:
|
444
|
+
# Offense count: 975
|
401
445
|
# Cop supports --auto-correct.
|
402
446
|
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
403
447
|
# URISchemes: http, https
|
404
|
-
|
405
|
-
Max:
|
448
|
+
Layout/LineLength:
|
449
|
+
Max: 217
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,20 @@
|
|
3
3
|
All notable changes to this project are documented in this file.
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
+
## RMagick 4.2.0
|
7
|
+
|
8
|
+
Improvements:
|
9
|
+
|
10
|
+
- Updated error messages if runtime ImageMagick version was not matched with when installed rmagick (#1213)
|
11
|
+
- Improve Image#resize performance with ImageMagick 7 (#1240)
|
12
|
+
- Added new colorspaces (#1252)
|
13
|
+
|
14
|
+
Bug Fixes:
|
15
|
+
|
16
|
+
- Fix assertion failed in Magick::TextureFill.new with with unexpected argument (#1216)
|
17
|
+
- Call with yield when there is a block arguments (#701)
|
18
|
+
- Avoid crash with monitor feature on Ruby 3.0 (#1253)
|
19
|
+
|
6
20
|
## RMagick 4.1.2
|
7
21
|
|
8
22
|
Bug Fixes:
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,13 +1,128 @@
|
|
1
|
-
# Contributor Code of Conduct
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
2
|
|
3
|
-
|
3
|
+
## Our Pledge
|
4
4
|
|
5
|
-
We
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity
|
10
|
+
and orientation.
|
6
11
|
|
7
|
-
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
13
|
+
diverse, inclusive, and healthy community.
|
8
14
|
|
9
|
-
|
15
|
+
## Our Standards
|
10
16
|
|
11
|
-
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
18
|
+
community include:
|
12
19
|
|
13
|
-
*
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
24
|
+
and learning from the experience
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the
|
26
|
+
overall community
|
27
|
+
|
28
|
+
Examples of unacceptable behavior include:
|
29
|
+
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or
|
31
|
+
advances of any kind
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
33
|
+
* Public or private harassment
|
34
|
+
* Publishing others' private information, such as a physical or email
|
35
|
+
address, without their explicit permission
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
37
|
+
professional setting
|
38
|
+
|
39
|
+
## Enforcement Responsibilities
|
40
|
+
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
44
|
+
or harmful.
|
45
|
+
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
49
|
+
decisions when appropriate.
|
50
|
+
|
51
|
+
## Scope
|
52
|
+
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
54
|
+
an individual is officially representing the community in public spaces.
|
55
|
+
Examples of representing our community include using an official e-mail address,
|
56
|
+
posting via an official social media account, or acting as an appointed
|
57
|
+
representative at an online or offline event.
|
58
|
+
|
59
|
+
## Enforcement
|
60
|
+
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
62
|
+
reported to the community leaders responsible for enforcement at
|
63
|
+
robert@boon.gl. All complaints will be reviewed and investigated promptly and
|
64
|
+
fairly.
|
65
|
+
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
67
|
+
reporter of any incident.
|
68
|
+
|
69
|
+
## Enforcement Guidelines
|
70
|
+
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
73
|
+
|
74
|
+
### 1. Correction
|
75
|
+
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
77
|
+
unprofessional or unwelcome in the community.
|
78
|
+
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
82
|
+
|
83
|
+
### 2. Warning
|
84
|
+
|
85
|
+
**Community Impact**: A violation through a single incident or series
|
86
|
+
of actions.
|
87
|
+
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
92
|
+
like social media. Violating these terms may lead to a temporary or
|
93
|
+
permanent ban.
|
94
|
+
|
95
|
+
### 3. Temporary Ban
|
96
|
+
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
98
|
+
sustained inappropriate behavior.
|
99
|
+
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
101
|
+
communication with the community for a specified period of time. No public or
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
104
|
+
Violating these terms may lead to a permanent ban.
|
105
|
+
|
106
|
+
### 4. Permanent Ban
|
107
|
+
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
111
|
+
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within
|
113
|
+
the community.
|
114
|
+
|
115
|
+
## Attribution
|
116
|
+
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
118
|
+
version 2.0, available at
|
119
|
+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
120
|
+
|
121
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
122
|
+
enforcement ladder](https://github.com/mozilla/diversity).
|
123
|
+
|
124
|
+
[homepage]: https://www.contributor-covenant.org
|
125
|
+
|
126
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
127
|
+
https://www.contributor-covenant.org/faq. Translations are available at
|
128
|
+
https://www.contributor-covenant.org/translations.
|
data/README.md
CHANGED
@@ -30,19 +30,27 @@ ImageMagick image processing library.
|
|
30
30
|
Prerequisites
|
31
31
|
-------------
|
32
32
|
|
33
|
-
These prerequisites are required for the latest
|
34
|
-
To see prerequisites for the latest RELEASED version of the gem, switch to the
|
35
|
-
master branch.
|
33
|
+
These prerequisites are required for the latest version of RMagick.
|
36
34
|
|
37
|
-
**
|
35
|
+
**OS**
|
36
|
+
- Linux
|
37
|
+
- \*BSD
|
38
|
+
- macOS
|
39
|
+
- Windows
|
40
|
+
- Other \*nix-like systems
|
38
41
|
|
39
|
-
**Ruby**
|
42
|
+
**Ruby**
|
43
|
+
- Version 2.3 or later.
|
44
|
+
|
45
|
+
You can get Ruby from <https://www.ruby-lang.org>.
|
40
46
|
|
41
47
|
Ruby must be able to build C-Extensions (e.g. MRI, Rubinius, not JRuby)
|
42
48
|
|
43
|
-
**ImageMagick**
|
44
|
-
|
45
|
-
|
49
|
+
**ImageMagick**
|
50
|
+
- Version 6.7.7 or later (6.x.x).
|
51
|
+
- Version 7.0.8 or later (7.x.x). Require RMagick 4.1.0 or later.
|
52
|
+
|
53
|
+
You can get ImageMagick from <https://imagemagick.org>.
|
46
54
|
|
47
55
|
### Linux
|
48
56
|
#### Ubuntu
|
data/before_install_linux.sh
CHANGED
@@ -24,7 +24,7 @@ sudo apt-get autoremove -y imagemagick* libmagick* --purge
|
|
24
24
|
# install build tools, ImageMagick delegates
|
25
25
|
sudo apt-get install -y build-essential libx11-dev libxext-dev zlib1g-dev \
|
26
26
|
liblcms2-dev libpng-dev libjpeg-dev libfreetype6-dev libxml2-dev \
|
27
|
-
libtiff5-dev libwebp-dev vim gsfonts ghostscript ccache
|
27
|
+
libtiff5-dev libwebp-dev liblqr-1-0-dev vim gsfonts ghostscript ccache
|
28
28
|
|
29
29
|
if [ ! -d /usr/include/freetype ]; then
|
30
30
|
# If `/usr/include/freetype` is not existed, ImageMagick 6.7 configuration fails about Freetype.
|
data/before_install_osx.sh
CHANGED
@@ -16,9 +16,9 @@ if [ ! -v IMAGEMAGICK_VERSION ]; then
|
|
16
16
|
fi
|
17
17
|
|
18
18
|
export HOMEBREW_NO_AUTO_UPDATE=true
|
19
|
-
brew install wget pkg-config ghostscript freetype jpeg little-cms2 libomp libpng libtiff libtool libxml2 zlib webp
|
19
|
+
brew install wget pkg-config ghostscript freetype jpeg little-cms2 libomp libpng libtiff liblqr libtool libxml2 zlib webp
|
20
20
|
|
21
|
-
export LDFLAGS="-L/usr/local/opt/libxml2/lib -L/usr/local/opt/zlib/
|
21
|
+
export LDFLAGS="-L/usr/local/opt/libxml2/lib -L/usr/local/opt/zlib/lib"
|
22
22
|
export CPPFLAGS="-I/usr/local/opt/libxml2/include/libxml2 -I/usr/local/opt/zlib/include"
|
23
23
|
|
24
24
|
project_dir=$(pwd)
|
data/ext/RMagick/extconf.rb
CHANGED
@@ -343,7 +343,10 @@ module RMagick
|
|
343
343
|
|
344
344
|
$defs.push('-DIMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9=1') if im_version_at_least?('6.8.9')
|
345
345
|
$defs.push('-DIMAGEMAGICK_GREATER_THAN_EQUAL_6_9_0=1') if im_version_at_least?('6.9.0')
|
346
|
+
$defs.push('-DIMAGEMAGICK_GREATER_THAN_EQUAL_6_9_10=1') if im_version_at_least?('6.9.10')
|
346
347
|
$defs.push('-DIMAGEMAGICK_7=1') if im_version_at_least?('7.0.0')
|
348
|
+
$defs.push('-DIMAGEMAGICK_GREATER_THAN_EQUAL_7_0_8=1') if im_version_at_least?('7.0.8')
|
349
|
+
$defs.push('-DIMAGEMAGICK_GREATER_THAN_EQUAL_7_0_10=1') if im_version_at_least?('7.0.10')
|
347
350
|
|
348
351
|
create_header
|
349
352
|
end
|
@@ -355,7 +358,7 @@ module RMagick
|
|
355
358
|
$defs = []
|
356
359
|
|
357
360
|
# Force re-compilation if the generated Makefile changed.
|
358
|
-
$config_h = 'Makefile
|
361
|
+
$config_h = 'Makefile'
|
359
362
|
|
360
363
|
create_makefile('RMagick2')
|
361
364
|
print_summary
|
data/ext/RMagick/rmagick.h
CHANGED
@@ -411,6 +411,8 @@ EXTERN ID rm_ID_push; /**< "push" */
|
|
411
411
|
EXTERN ID rm_ID_values; /**< "values" */
|
412
412
|
EXTERN ID rm_ID_width; /**< "width" */
|
413
413
|
|
414
|
+
EXTERN unsigned long long rm_main_thread_id;
|
415
|
+
|
414
416
|
#if !defined(min)
|
415
417
|
#define min(a, b) ((a)<(b)?(a):(b)) /**< min of two values */
|
416
418
|
#endif
|
@@ -1197,6 +1199,7 @@ extern void rm_error_handler(const ExceptionType, const char *, const char *);
|
|
1197
1199
|
extern void rm_warning_handler(const ExceptionType, const char *, const char *);
|
1198
1200
|
extern MagickBooleanType rm_should_raise_exception(ExceptionInfo *, const ExceptionRetention);
|
1199
1201
|
extern void rm_raise_exception(ExceptionInfo *);
|
1202
|
+
extern unsigned long long rm_current_thread_id();
|
1200
1203
|
#if defined(IMAGEMAGICK_6)
|
1201
1204
|
extern void rm_check_image_exception(Image *, ErrorRetention);
|
1202
1205
|
#endif
|
data/ext/RMagick/rmdraw.c
CHANGED
@@ -853,7 +853,16 @@ VALUE Draw_annotate(
|
|
853
853
|
// allowing the app a chance to modify the object's attributes
|
854
854
|
if (rb_block_given_p())
|
855
855
|
{
|
856
|
-
|
856
|
+
if (rb_proc_arity(rb_block_proc()) == 0)
|
857
|
+
{
|
858
|
+
// Run the block in self's context
|
859
|
+
rb_warn("passing a block without an image argument is deprecated");
|
860
|
+
rb_obj_instance_eval(0, NULL, self);
|
861
|
+
}
|
862
|
+
else
|
863
|
+
{
|
864
|
+
rb_yield(self);
|
865
|
+
}
|
857
866
|
}
|
858
867
|
|
859
868
|
// Translate & store in Draw structure
|
@@ -1385,8 +1394,16 @@ DrawOptions_initialize(VALUE self)
|
|
1385
1394
|
|
1386
1395
|
if (rb_block_given_p())
|
1387
1396
|
{
|
1388
|
-
|
1389
|
-
|
1397
|
+
if (rb_proc_arity(rb_block_proc()) == 0)
|
1398
|
+
{
|
1399
|
+
// Run the block in self's context
|
1400
|
+
rb_warn("passing a block without an image argument is deprecated");
|
1401
|
+
rb_obj_instance_eval(0, NULL, self);
|
1402
|
+
}
|
1403
|
+
else
|
1404
|
+
{
|
1405
|
+
rb_yield(self);
|
1406
|
+
}
|
1390
1407
|
}
|
1391
1408
|
|
1392
1409
|
return self;
|
@@ -1449,9 +1466,18 @@ PolaroidOptions_initialize(VALUE self)
|
|
1449
1466
|
|
1450
1467
|
if (rb_block_given_p())
|
1451
1468
|
{
|
1452
|
-
|
1453
|
-
|
1469
|
+
if (rb_proc_arity(rb_block_proc()) == 0)
|
1470
|
+
{
|
1471
|
+
// Run the block in self's context
|
1472
|
+
rb_warn("passing a block without an image argument is deprecated");
|
1473
|
+
rb_obj_instance_eval(0, NULL, self);
|
1474
|
+
}
|
1475
|
+
else
|
1476
|
+
{
|
1477
|
+
rb_yield(self);
|
1478
|
+
}
|
1454
1479
|
}
|
1480
|
+
|
1455
1481
|
return self;
|
1456
1482
|
}
|
1457
1483
|
|
data/ext/RMagick/rmfill.c
CHANGED
@@ -667,7 +667,10 @@ free_TextureFill(void *fill_obj)
|
|
667
667
|
rm_TextureFill *fill = (rm_TextureFill *)fill_obj;
|
668
668
|
|
669
669
|
// Do not trace destruction
|
670
|
-
|
670
|
+
if (fill->texture)
|
671
|
+
{
|
672
|
+
DestroyImage(fill->texture);
|
673
|
+
}
|
671
674
|
xfree(fill);
|
672
675
|
}
|
673
676
|
|
data/ext/RMagick/rmilist.c
CHANGED
@@ -446,7 +446,15 @@ ImageList_montage(VALUE self)
|
|
446
446
|
{
|
447
447
|
// Run the block in the instance's context, allowing the app to modify the
|
448
448
|
// object's attributes.
|
449
|
-
|
449
|
+
if (rb_proc_arity(rb_block_proc()) == 0)
|
450
|
+
{
|
451
|
+
rb_warn("passing a block without an image argument is deprecated");
|
452
|
+
rb_obj_instance_eval(0, NULL, montage_obj);
|
453
|
+
}
|
454
|
+
else
|
455
|
+
{
|
456
|
+
rb_yield(montage_obj);
|
457
|
+
}
|
450
458
|
}
|
451
459
|
|
452
460
|
Data_Get_Struct(montage_obj, Montage, montage);
|
data/ext/RMagick/rmimage.c
CHANGED
@@ -11660,9 +11660,12 @@ resize(int bang, int argc, VALUE *argv, VALUE self)
|
|
11660
11660
|
|
11661
11661
|
exception = AcquireExceptionInfo();
|
11662
11662
|
#if defined(IMAGEMAGICK_7)
|
11663
|
-
Image *preprocess = blurred_image(image, blur);
|
11663
|
+
Image *preprocess = (argc == 4) ? blurred_image(image, blur) : image;
|
11664
11664
|
new_image = ResizeImage(preprocess, columns, rows, filter, exception);
|
11665
|
-
|
11665
|
+
if (argc == 4)
|
11666
|
+
{
|
11667
|
+
DestroyImage(preprocess);
|
11668
|
+
}
|
11666
11669
|
#else
|
11667
11670
|
new_image = ResizeImage(image, columns, rows, filter, blur, exception);
|
11668
11671
|
#endif
|
data/ext/RMagick/rminfo.c
CHANGED
@@ -2414,8 +2414,16 @@ Info_initialize(VALUE self)
|
|
2414
2414
|
{
|
2415
2415
|
if (rb_block_given_p())
|
2416
2416
|
{
|
2417
|
-
|
2418
|
-
|
2417
|
+
if (rb_proc_arity(rb_block_proc()) == 0)
|
2418
|
+
{
|
2419
|
+
// Run the block in self's context
|
2420
|
+
rb_warn("passing a block without an image argument is deprecated");
|
2421
|
+
rb_obj_instance_eval(0, NULL, self);
|
2422
|
+
}
|
2423
|
+
else
|
2424
|
+
{
|
2425
|
+
rb_yield(self);
|
2426
|
+
}
|
2419
2427
|
}
|
2420
2428
|
return self;
|
2421
2429
|
}
|
data/ext/RMagick/rmmain.c
CHANGED
@@ -242,6 +242,8 @@ Init_RMagick2(void)
|
|
242
242
|
|
243
243
|
test_Magick_version();
|
244
244
|
|
245
|
+
rm_main_thread_id = rm_current_thread_id();
|
246
|
+
|
245
247
|
/*-----------------------------------------------------------------------*/
|
246
248
|
/* Create IDs for frequently used methods, etc. */
|
247
249
|
/*-----------------------------------------------------------------------*/
|
@@ -1130,6 +1132,16 @@ Init_RMagick2(void)
|
|
1130
1132
|
ENUMERATOR(HCLpColorspace)
|
1131
1133
|
ENUMERATOR(YDbDrColorspace)
|
1132
1134
|
ENUMERATORV(XyYColorspace, xyYColorspace)
|
1135
|
+
#endif
|
1136
|
+
#if defined(IMAGEMAGICK_7)
|
1137
|
+
#if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_7_0_8)
|
1138
|
+
ENUMERATOR(LinearGRAYColorspace)
|
1139
|
+
#endif
|
1140
|
+
#if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_7_0_10)
|
1141
|
+
ENUMERATOR(JzazbzColorspace)
|
1142
|
+
#endif
|
1143
|
+
#elif defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_9_10)
|
1144
|
+
ENUMERATOR(LinearGRAYColorspace)
|
1133
1145
|
#endif
|
1134
1146
|
END_ENUM
|
1135
1147
|
|
@@ -1870,7 +1882,8 @@ test_Magick_version(void)
|
|
1870
1882
|
}
|
1871
1883
|
|
1872
1884
|
rb_raise(rb_eRuntimeError,
|
1873
|
-
"This installation of RMagick was configured with %s %s but %.*s is in use.\n"
|
1885
|
+
"This installation of RMagick was configured with %s %s but %.*s is in use.\n"
|
1886
|
+
"Please re-install RMagick to correct the issue.\n",
|
1874
1887
|
MagickPackageName, MagickLibVersionText, x, version_str);
|
1875
1888
|
}
|
1876
1889
|
|
data/ext/RMagick/rmutil.c
CHANGED
@@ -1000,7 +1000,16 @@ rm_get_optional_arguments(VALUE img)
|
|
1000
1000
|
optional_method_arguments = rb_const_get_from(Module_Magick, rb_intern("OptionalMethodArguments"));
|
1001
1001
|
argv[0] = img;
|
1002
1002
|
opt_args = rb_class_new_instance(1, argv, optional_method_arguments);
|
1003
|
-
|
1003
|
+
|
1004
|
+
if (rb_proc_arity(rb_block_proc()) == 0)
|
1005
|
+
{
|
1006
|
+
rb_warn("passing a block without an image argument is deprecated");
|
1007
|
+
rb_obj_instance_eval(0, NULL, opt_args);
|
1008
|
+
}
|
1009
|
+
else
|
1010
|
+
{
|
1011
|
+
rb_yield(opt_args);
|
1012
|
+
}
|
1004
1013
|
}
|
1005
1014
|
|
1006
1015
|
RB_GC_GUARD(optional_method_arguments);
|
@@ -1530,14 +1539,15 @@ rm_progress_monitor(
|
|
1530
1539
|
VALUE rval;
|
1531
1540
|
VALUE method, offset, span;
|
1532
1541
|
|
1533
|
-
//
|
1534
|
-
|
1535
|
-
|
1536
|
-
// Check stack length manually instead of ruby_stack_check() for old Ruby.
|
1537
|
-
if (ruby_stack_length(NULL) > RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN)
|
1542
|
+
// Check running thread.
|
1543
|
+
if (rm_current_thread_id() != rm_main_thread_id)
|
1538
1544
|
{
|
1539
|
-
//
|
1540
|
-
//
|
1545
|
+
// ImageMagick might call back in a different thread than Ruby is running in.
|
1546
|
+
// If it is a different thread, it would not have a Ruby GVL and
|
1547
|
+
// it could not retrieve properly Ruby stack.
|
1548
|
+
|
1549
|
+
// Unfortunately, there is no API available to check if the current thread has a GVL,
|
1550
|
+
// so the thread id was checked in here.
|
1541
1551
|
return MagickTrue;
|
1542
1552
|
}
|
1543
1553
|
|
@@ -1868,3 +1878,21 @@ rm_raise_exception(ExceptionInfo *exception)
|
|
1868
1878
|
rm_magick_error(msg);
|
1869
1879
|
}
|
1870
1880
|
|
1881
|
+
/**
|
1882
|
+
* Get current thread id.
|
1883
|
+
*
|
1884
|
+
* No Ruby usage (internal function)
|
1885
|
+
*
|
1886
|
+
* @return thread id
|
1887
|
+
*/
|
1888
|
+
unsigned long long
|
1889
|
+
rm_current_thread_id()
|
1890
|
+
{
|
1891
|
+
#if defined(_WIN32)
|
1892
|
+
#include <Windows.h>
|
1893
|
+
return (unsigned long long)GetCurrentThreadId();
|
1894
|
+
#else
|
1895
|
+
#include <pthread.h>
|
1896
|
+
return (unsigned long long)pthread_self();
|
1897
|
+
#endif
|
1898
|
+
}
|
data/lib/rmagick/version.rb
CHANGED
data/rmagick.gemspec
CHANGED
@@ -31,8 +31,9 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.add_development_dependency 'rspec', '~> 3.8'
|
32
32
|
s.add_development_dependency 'rspec_junit_formatter', '~> 0.4.1'
|
33
33
|
if RUBY_PLATFORM !~ /mswin|mingw/
|
34
|
-
s.add_development_dependency 'rubocop', '~> 0.
|
35
|
-
s.add_development_dependency 'rubocop-rspec', '~> 1.
|
34
|
+
s.add_development_dependency 'rubocop', '~> 0.81.0'
|
35
|
+
s.add_development_dependency 'rubocop-rspec', '~> 1.38.1'
|
36
|
+
s.add_development_dependency 'rubocop-performance', '~> 1.5.2'
|
36
37
|
end
|
37
38
|
s.add_development_dependency 'simplecov', '~> 0.16.1'
|
38
39
|
s.add_development_dependency 'yard', '~> 0.9.24'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rmagick
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Hunter
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2021-02-05 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: pry
|
@@ -75,28 +75,42 @@ dependencies:
|
|
75
75
|
requirements:
|
76
76
|
- - "~>"
|
77
77
|
- !ruby/object:Gem::Version
|
78
|
-
version: 0.
|
78
|
+
version: 0.81.0
|
79
79
|
type: :development
|
80
80
|
prerelease: false
|
81
81
|
version_requirements: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
83
|
- - "~>"
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 0.
|
85
|
+
version: 0.81.0
|
86
86
|
- !ruby/object:Gem::Dependency
|
87
87
|
name: rubocop-rspec
|
88
88
|
requirement: !ruby/object:Gem::Requirement
|
89
89
|
requirements:
|
90
90
|
- - "~>"
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version: 1.
|
92
|
+
version: 1.38.1
|
93
93
|
type: :development
|
94
94
|
prerelease: false
|
95
95
|
version_requirements: !ruby/object:Gem::Requirement
|
96
96
|
requirements:
|
97
97
|
- - "~>"
|
98
98
|
- !ruby/object:Gem::Version
|
99
|
-
version: 1.
|
99
|
+
version: 1.38.1
|
100
|
+
- !ruby/object:Gem::Dependency
|
101
|
+
name: rubocop-performance
|
102
|
+
requirement: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - "~>"
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: 1.5.2
|
107
|
+
type: :development
|
108
|
+
prerelease: false
|
109
|
+
version_requirements: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - "~>"
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: 1.5.2
|
100
114
|
- !ruby/object:Gem::Dependency
|
101
115
|
name: simplecov
|
102
116
|
requirement: !ruby/object:Gem::Requirement
|
@@ -206,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
220
|
version: '0'
|
207
221
|
requirements:
|
208
222
|
- ImageMagick 6.7.7 or later
|
209
|
-
rubygems_version: 3.
|
223
|
+
rubygems_version: 3.1.4
|
210
224
|
signing_key:
|
211
225
|
specification_version: 4
|
212
226
|
summary: Ruby binding to ImageMagick
|