rmagick 4.1.0 → 4.2.2
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/ISSUE_TEMPLATE.md +17 -0
- data/.github/workflows/ci.yml +16 -57
- data/.rubocop_todo.yml +114 -70
- data/CHANGELOG.md +53 -0
- data/CODE_OF_CONDUCT.md +122 -7
- data/README.md +43 -11
- data/before_install_linux.sh +1 -1
- data/before_install_osx.sh +3 -2
- data/ext/RMagick/extconf.rb +8 -1
- data/ext/RMagick/rmagick.h +3 -0
- data/ext/RMagick/rmdraw.c +28 -5
- data/ext/RMagick/rmfill.c +4 -1
- data/ext/RMagick/rmilist.c +8 -1
- data/ext/RMagick/rmimage.c +19 -7
- data/ext/RMagick/rminfo.c +9 -2
- data/ext/RMagick/rmmain.c +16 -3
- data/ext/RMagick/rmutil.c +39 -11
- data/lib/rmagick/version.rb +1 -1
- data/rmagick.gemspec +3 -2
- metadata +22 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c383bce80132c17b4d8a6afab0085b2f4d5d23f582473d9405b5f6dcb3d6283f
|
4
|
+
data.tar.gz: 0f5f7afe6df7a1c5095860ca5341d0b72a4960b8ead6a2779bd8209a92078f95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 619e5ec7f5fbd0750fb5bc4807d9d7ca0e58b6ba6e3efc9726541bbe3c260a748c026446ce89ef51661254b5285f907254d9b389cb237e141bd525fa23bbf2b6
|
7
|
+
data.tar.gz: 50e98c64b22c0bbf9d4b5aafd6664d02abdc2d8286a703e9199aed8b5e9597c4ce1ec4abeceabed20c21b5ab6d703b0ff9d4d81637d08b2c2ba93e615b02184f
|
@@ -0,0 +1,17 @@
|
|
1
|
+
### Description
|
2
|
+
<!-- A description of the bug or feature -->
|
3
|
+
|
4
|
+
### Steps to Reproduce
|
5
|
+
<!-- List of steps, sample code, failing test or link to a project that reproduces the behavior.
|
6
|
+
Make sure you place a stack trace inside a code (```) block to avoid linking unrelated issues -->
|
7
|
+
|
8
|
+
### System Configuration
|
9
|
+
<!-- Tell us about the environment where you are experiencing the bug -->
|
10
|
+
|
11
|
+
- ImageMagick version:
|
12
|
+
- RMagick version:
|
13
|
+
- Ruby version:
|
14
|
+
- Environment (Operating system, version and so on):
|
15
|
+
- Additional information:
|
16
|
+
|
17
|
+
<!-- Thanks for reporting the issue to RMagick! -->
|
data/.github/workflows/ci.yml
CHANGED
@@ -3,10 +3,9 @@ name: CI
|
|
3
3
|
on:
|
4
4
|
push:
|
5
5
|
branches:
|
6
|
-
-
|
6
|
+
- main
|
7
7
|
pull_request:
|
8
|
-
|
9
|
-
- master
|
8
|
+
workflow_dispatch:
|
10
9
|
|
11
10
|
jobs:
|
12
11
|
lint:
|
@@ -17,14 +16,7 @@ jobs:
|
|
17
16
|
- name: Set up Ruby 2.3
|
18
17
|
uses: ruby/setup-ruby@master
|
19
18
|
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') }}
|
19
|
+
ruby-version: '2.3'
|
28
20
|
- name: Build and test with Rake
|
29
21
|
run: |
|
30
22
|
bundle install --path=vendor/bundle --jobs 4 --retry 3
|
@@ -35,23 +27,16 @@ jobs:
|
|
35
27
|
timeout-minutes: 10
|
36
28
|
strategy:
|
37
29
|
matrix:
|
38
|
-
ruby-version: [2.3, 2.4, 2.5, 2.6, 2.7]
|
30
|
+
ruby-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0']
|
39
31
|
imagemagick-version:
|
40
32
|
- { full: 6.7.7-10, major-minor: '6.7' }
|
41
33
|
- { full: 6.8.9-10, major-minor: '6.8' }
|
42
|
-
- { full: 6.9.11-
|
43
|
-
- { full: 7.0.10-
|
34
|
+
- { full: 6.9.11-58, major-minor: '6.9' }
|
35
|
+
- { full: 7.0.10-58, major-minor: '7.0' }
|
44
36
|
|
45
37
|
name: Linux, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
|
46
38
|
steps:
|
47
39
|
- uses: actions/checkout@v2
|
48
|
-
- name: Cache ImageMagick
|
49
|
-
uses: actions/cache@v1
|
50
|
-
with:
|
51
|
-
path: ./build-ImageMagick
|
52
|
-
key: v1-imagemagick-${{ matrix.imagemagick-version.full }}
|
53
|
-
restore-keys: |
|
54
|
-
v1-imagemagick-${{ matrix.imagemagick-version.full }}
|
55
40
|
- name: Set up Ruby ${{ matrix.ruby-version }}
|
56
41
|
uses: ruby/setup-ruby@master
|
57
42
|
with:
|
@@ -60,13 +45,6 @@ jobs:
|
|
60
45
|
run: |
|
61
46
|
export IMAGEMAGICK_VERSION=${{ matrix.imagemagick-version.full }}
|
62
47
|
./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
48
|
- name: Build and test with Rake
|
71
49
|
run: |
|
72
50
|
bundle install --path=vendor/bundle --jobs 4 --retry 3
|
@@ -74,37 +52,24 @@ jobs:
|
|
74
52
|
|
75
53
|
test-macos:
|
76
54
|
runs-on: macos-latest
|
55
|
+
timeout-minutes: 20
|
77
56
|
strategy:
|
78
57
|
matrix:
|
79
|
-
ruby-version: [2.6, 2.7]
|
58
|
+
ruby-version: ['2.6', '2.7', '3.0']
|
80
59
|
imagemagick-version:
|
81
|
-
- { full: 6.9.11-
|
82
|
-
- { full: 7.0.10-
|
60
|
+
- { full: 6.9.11-58, major-minor: '6.9' }
|
61
|
+
- { full: 7.0.10-58, major-minor: '7.0' }
|
83
62
|
|
84
63
|
name: macOS, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
|
85
64
|
steps:
|
86
65
|
- 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
66
|
- name: Set up Ruby ${{ matrix.ruby-version }}
|
95
|
-
uses:
|
67
|
+
uses: ruby/setup-ruby@master
|
96
68
|
with:
|
97
69
|
ruby-version: ${{ matrix.ruby-version }}
|
98
70
|
- name: Update/Install packages
|
99
71
|
run: |
|
100
72
|
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
73
|
- name: Build and test with Rake
|
109
74
|
run: |
|
110
75
|
bundle install --path=vendor/bundle --jobs 4 --retry 3
|
@@ -115,11 +80,11 @@ jobs:
|
|
115
80
|
timeout-minutes: 10
|
116
81
|
strategy:
|
117
82
|
matrix:
|
118
|
-
ruby-version: [2.3, 2.4, 2.5, 2.6]
|
83
|
+
ruby-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0']
|
119
84
|
imagemagick-version:
|
120
85
|
- { full: 6.8.9-10, major-minor: '6.8' }
|
121
|
-
- { full: 6.9.11-
|
122
|
-
- { full: 7.0.10-
|
86
|
+
- { full: 6.9.11-29, major-minor: '6.9' } # seems that binary file mirroring have stopped.
|
87
|
+
- { full: 7.0.10-29, major-minor: '7.0' } # seems that binary file mirroring have stopped.
|
123
88
|
name: MSWin, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
|
124
89
|
steps:
|
125
90
|
- uses: actions/checkout@v2
|
@@ -133,16 +98,10 @@ jobs:
|
|
133
98
|
$imagemagick_version_without_patch = $imagemagick_version.split("-")[0]
|
134
99
|
$installer_name = "ImageMagick-$($imagemagick_version)-Q16-x64-dll.exe"
|
135
100
|
$url = "https://ftp.icm.edu.pl/pub/graphics/ImageMagick/binaries/$($installer_name)"
|
101
|
+
choco install wget
|
102
|
+
choco install ghostscript -Version 9.50
|
136
103
|
wget $url --progress=dot
|
137
104
|
cmd.exe /D /S /C "$($installer_name) /DIR=D:\ImageMagick /VERYSILENT /TASKS=install_Devel"
|
138
|
-
cmd.exe /D /S /C "choco install ghostscript"
|
139
|
-
- name: Cache Ruby dependencies
|
140
|
-
uses: actions/cache@v1
|
141
|
-
with:
|
142
|
-
path: ./vendor/bundle
|
143
|
-
key: v1-windows-${{ matrix.ruby-version }}-${{ hashFiles('rmagick.gemspec') }}
|
144
|
-
restore-keys: |
|
145
|
-
v1-windows-${{ matrix.ruby-version }}-${{ hashFiles('rmagick.gemspec') }}
|
146
105
|
- name: Build and test with Rake
|
147
106
|
run: |
|
148
107
|
cmd.exe /D /S /C "SET MAKE=make & SET PATH=D:\ImageMagick;%PATH% & bundle install --path=vendor/bundle --retry 3 & bundle exec 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,59 @@
|
|
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.2
|
7
|
+
|
8
|
+
Bug Fixes:
|
9
|
+
|
10
|
+
- Remove deprecation warning about block syntax (#1272)
|
11
|
+
|
12
|
+
You are still recommended to use the block parameter instead of `self.` but
|
13
|
+
we're silencing the deprecation warning until we can get RMagick's code up to
|
14
|
+
that standard.
|
15
|
+
|
16
|
+
## RMagick 4.2.1
|
17
|
+
|
18
|
+
Bug Fixes:
|
19
|
+
|
20
|
+
- Fix compilation with optimization on glibc (#1263)
|
21
|
+
|
22
|
+
## RMagick 4.2.0
|
23
|
+
|
24
|
+
This adds a deprecation warning when using a block for image operations.
|
25
|
+
Instead of setting properties on `self`, you should accept a block argument and
|
26
|
+
modify that instead. In a future version we we no longer be binding the block
|
27
|
+
to the image.
|
28
|
+
|
29
|
+
```diff
|
30
|
+
- img.to_blob { self.quality = 75 }
|
31
|
+
+ img.to_blob { |image| image.quality = 75 }
|
32
|
+
```
|
33
|
+
|
34
|
+
Improvements:
|
35
|
+
|
36
|
+
- Updated error messages if runtime ImageMagick version was not matched with when installed rmagick (#1213)
|
37
|
+
- Improve Image#resize performance with ImageMagick 7 (#1240)
|
38
|
+
- Added new colorspaces (#1252)
|
39
|
+
|
40
|
+
Bug Fixes:
|
41
|
+
|
42
|
+
- Fix assertion failed in Magick::TextureFill.new with with unexpected argument (#1216)
|
43
|
+
- Call with yield when there is a block arguments (#701)
|
44
|
+
- Avoid crash with monitor feature on Ruby 3.0 (#1253)
|
45
|
+
|
46
|
+
## RMagick 4.1.2
|
47
|
+
|
48
|
+
Bug Fixes:
|
49
|
+
|
50
|
+
- Fix build error on Freebsd (#1199)
|
51
|
+
- Add workaround for FreeBSD that it isn't able to process PDF (#1203)
|
52
|
+
|
53
|
+
## RMagick 4.1.1
|
54
|
+
|
55
|
+
Bug Fixes:
|
56
|
+
|
57
|
+
- Fix bug of signal handling internally (#1189)
|
58
|
+
|
6
59
|
## RMagick 4.1.0
|
7
60
|
|
8
61
|
Improvements:
|
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,33 +30,63 @@ 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
|
56
|
+
#### Ubuntu
|
48
57
|
On Ubuntu, you can run:
|
49
58
|
|
50
59
|
```sh
|
51
60
|
sudo apt-get install libmagickwand-dev
|
52
61
|
```
|
53
62
|
|
63
|
+
#### Centos
|
54
64
|
On Centos, you can run:
|
55
65
|
|
56
66
|
```sh
|
57
67
|
sudo yum install gcc ImageMagick-devel make which
|
58
68
|
```
|
59
69
|
|
70
|
+
#### Arch Linux
|
71
|
+
On Arch Linux, you can run:
|
72
|
+
|
73
|
+
```sh
|
74
|
+
pacman -Syy pkg-config imagemagick
|
75
|
+
```
|
76
|
+
|
77
|
+
#### Alpine Linux
|
78
|
+
On Alpine Linux, you can run:
|
79
|
+
|
80
|
+
```
|
81
|
+
apk add pkgconfig imagemagick imagemagick-dev imagemagick-libs
|
82
|
+
```
|
83
|
+
|
84
|
+
or you can run if you would like to use ImageMagick 6:
|
85
|
+
|
86
|
+
```
|
87
|
+
apk add pkgconfig imagemagick6 imagemagick6-dev imagemagick6-libs
|
88
|
+
```
|
89
|
+
|
60
90
|
### macOS
|
61
91
|
On macOS, you can run:
|
62
92
|
|
@@ -72,8 +102,10 @@ brew install pkg-config imagemagick@6
|
|
72
102
|
|
73
103
|
### Windows
|
74
104
|
1. Install latest Ruby+Devkit package which you can get from [RubyInstaller for Windows](https://rubyinstaller.org).
|
75
|
-
2.
|
76
|
-
|
105
|
+
2. You might need to configure `PATH` environment variable to where the compiler is located.
|
106
|
+
(Ex: `set PATH=C:\Ruby27-x64\msys64\usr\bin;C:\Ruby27-x64\msys64\mingw64\bin;%PATH%`)
|
107
|
+
3. Download `ImageMagick-7.XXXX-Q16-x64-dll.exe` (not, `ImageMagick-7.XXXX-Q16-x64-static.exe`) binary from [Windows Binary Release](https://imagemagick.org/script/download.php#windows), or you can download ImageMagick 6 from [Windows Binary Release](https://legacy.imagemagick.org/script/download.php#windows).
|
108
|
+
4. Install ImageMagick. You need to turn on checkboxes `Add application directory to your system path` and `Install development headers and librarries for C and C++` in an installer for RMagick.
|
77
109
|
<img width="50%" src="https://user-images.githubusercontent.com/199156/77183472-b72cbd00-6b11-11ea-8b9a-247bc1f9d8b1.png" />
|
78
110
|
|
79
111
|
Installing RMagick
|
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
@@ -15,9 +15,10 @@ if [ ! -v IMAGEMAGICK_VERSION ]; then
|
|
15
15
|
exit 1
|
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 liblqr libtool libxml2 zlib webp
|
19
20
|
|
20
|
-
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"
|
21
22
|
export CPPFLAGS="-I/usr/local/opt/libxml2/include/libxml2 -I/usr/local/opt/zlib/include"
|
22
23
|
|
23
24
|
project_dir=$(pwd)
|
data/ext/RMagick/extconf.rb
CHANGED
@@ -333,13 +333,20 @@ module RMagick
|
|
333
333
|
have_func(func, headers)
|
334
334
|
end
|
335
335
|
|
336
|
+
unless have_header('malloc.h')
|
337
|
+
have_header('malloc/malloc.h')
|
338
|
+
end
|
339
|
+
|
336
340
|
# Miscellaneous constants
|
337
341
|
$defs.push("-DRUBY_VERSION_STRING=\"ruby #{RUBY_VERSION}\"")
|
338
342
|
$defs.push("-DRMAGICK_VERSION_STRING=\"RMagick #{RMAGICK_VERS}\"")
|
339
343
|
|
340
344
|
$defs.push('-DIMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9=1') if im_version_at_least?('6.8.9')
|
341
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')
|
342
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')
|
343
350
|
|
344
351
|
create_header
|
345
352
|
end
|
@@ -351,7 +358,7 @@ module RMagick
|
|
351
358
|
$defs = []
|
352
359
|
|
353
360
|
# Force re-compilation if the generated Makefile changed.
|
354
|
-
$config_h = 'Makefile
|
361
|
+
$config_h = 'Makefile'
|
355
362
|
|
356
363
|
create_makefile('RMagick2')
|
357
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,15 @@ 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_obj_instance_eval(0, NULL, self);
|
860
|
+
}
|
861
|
+
else
|
862
|
+
{
|
863
|
+
rb_yield(self);
|
864
|
+
}
|
857
865
|
}
|
858
866
|
|
859
867
|
// Translate & store in Draw structure
|
@@ -1385,8 +1393,15 @@ DrawOptions_initialize(VALUE self)
|
|
1385
1393
|
|
1386
1394
|
if (rb_block_given_p())
|
1387
1395
|
{
|
1388
|
-
|
1389
|
-
|
1396
|
+
if (rb_proc_arity(rb_block_proc()) == 0)
|
1397
|
+
{
|
1398
|
+
// Run the block in self's context
|
1399
|
+
rb_obj_instance_eval(0, NULL, self);
|
1400
|
+
}
|
1401
|
+
else
|
1402
|
+
{
|
1403
|
+
rb_yield(self);
|
1404
|
+
}
|
1390
1405
|
}
|
1391
1406
|
|
1392
1407
|
return self;
|
@@ -1449,9 +1464,17 @@ PolaroidOptions_initialize(VALUE self)
|
|
1449
1464
|
|
1450
1465
|
if (rb_block_given_p())
|
1451
1466
|
{
|
1452
|
-
|
1453
|
-
|
1467
|
+
if (rb_proc_arity(rb_block_proc()) == 0)
|
1468
|
+
{
|
1469
|
+
// Run the block in self's context
|
1470
|
+
rb_obj_instance_eval(0, NULL, self);
|
1471
|
+
}
|
1472
|
+
else
|
1473
|
+
{
|
1474
|
+
rb_yield(self);
|
1475
|
+
}
|
1454
1476
|
}
|
1477
|
+
|
1455
1478
|
return self;
|
1456
1479
|
}
|
1457
1480
|
|
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,14 @@ 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_obj_instance_eval(0, NULL, montage_obj);
|
452
|
+
}
|
453
|
+
else
|
454
|
+
{
|
455
|
+
rb_yield(montage_obj);
|
456
|
+
}
|
450
457
|
}
|
451
458
|
|
452
459
|
Data_Get_Struct(montage_obj, Montage, montage);
|
data/ext/RMagick/rmimage.c
CHANGED
@@ -11049,7 +11049,7 @@ file_arg_rescue(VALUE arg, VALUE raised_exc ATTRIBUTE_UNUSED)
|
|
11049
11049
|
* @see array_from_images
|
11050
11050
|
*/
|
11051
11051
|
|
11052
|
-
#if
|
11052
|
+
#if defined(__APPLE__) || defined(__FreeBSD__)
|
11053
11053
|
void sig_handler(int sig ATTRIBUTE_UNUSED)
|
11054
11054
|
{
|
11055
11055
|
}
|
@@ -11097,14 +11097,23 @@ rd_image(VALUE class ATTRIBUTE_UNUSED, VALUE file, reader_t reader)
|
|
11097
11097
|
|
11098
11098
|
exception = AcquireExceptionInfo();
|
11099
11099
|
|
11100
|
-
#if
|
11101
|
-
|
11100
|
+
#if defined(__APPLE__) || defined(__FreeBSD__)
|
11101
|
+
struct sigaction act, oldact;
|
11102
|
+
act.sa_handler = sig_handler;
|
11103
|
+
act.sa_flags = SA_RESTART;
|
11104
|
+
if (sigaction(SIGCHLD, &act, &oldact) < 0)
|
11105
|
+
{
|
11106
|
+
rb_sys_fail("sigaction");
|
11107
|
+
}
|
11102
11108
|
#endif
|
11103
11109
|
|
11104
11110
|
images = (reader)(info, exception);
|
11105
11111
|
|
11106
|
-
#if
|
11107
|
-
|
11112
|
+
#if defined(__APPLE__) || defined(__FreeBSD__)
|
11113
|
+
if (sigaction(SIGCHLD, &oldact, NULL) < 0)
|
11114
|
+
{
|
11115
|
+
rb_sys_fail("sigaction");
|
11116
|
+
}
|
11108
11117
|
#endif
|
11109
11118
|
|
11110
11119
|
rm_check_exception(exception, images, DestroyOnError);
|
@@ -11651,9 +11660,12 @@ resize(int bang, int argc, VALUE *argv, VALUE self)
|
|
11651
11660
|
|
11652
11661
|
exception = AcquireExceptionInfo();
|
11653
11662
|
#if defined(IMAGEMAGICK_7)
|
11654
|
-
Image *preprocess = blurred_image(image, blur);
|
11663
|
+
Image *preprocess = (argc == 4) ? blurred_image(image, blur) : image;
|
11655
11664
|
new_image = ResizeImage(preprocess, columns, rows, filter, exception);
|
11656
|
-
|
11665
|
+
if (argc == 4)
|
11666
|
+
{
|
11667
|
+
DestroyImage(preprocess);
|
11668
|
+
}
|
11657
11669
|
#else
|
11658
11670
|
new_image = ResizeImage(image, columns, rows, filter, blur, exception);
|
11659
11671
|
#endif
|
data/ext/RMagick/rminfo.c
CHANGED
@@ -2414,8 +2414,15 @@ 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_obj_instance_eval(0, NULL, self);
|
2421
|
+
}
|
2422
|
+
else
|
2423
|
+
{
|
2424
|
+
rb_yield(self);
|
2425
|
+
}
|
2419
2426
|
}
|
2420
2427
|
return self;
|
2421
2428
|
}
|
data/ext/RMagick/rmmain.c
CHANGED
@@ -18,9 +18,9 @@
|
|
18
18
|
#if defined(HAVE_POSIX_MEMALIGN) || defined(HAVE__ALIGNED_MSIZE)
|
19
19
|
#define USE_RM_ALIGNED_MALLOC 1
|
20
20
|
|
21
|
-
#if defined(
|
21
|
+
#if defined(HAVE_MALLOC_H)
|
22
22
|
#include <malloc.h>
|
23
|
-
#elif defined(
|
23
|
+
#elif defined(HAVE_MALLOC_MALLOC_H)
|
24
24
|
#include <malloc/malloc.h>
|
25
25
|
#endif
|
26
26
|
#endif
|
@@ -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
@@ -12,6 +12,11 @@
|
|
12
12
|
|
13
13
|
#include "rmagick.h"
|
14
14
|
#include <errno.h>
|
15
|
+
#if defined(_WIN32)
|
16
|
+
#include <Windows.h>
|
17
|
+
#else
|
18
|
+
#include <pthread.h>
|
19
|
+
#endif
|
15
20
|
|
16
21
|
static VALUE rescue_not_str(VALUE, VALUE ATTRIBUTE_UNUSED) ATTRIBUTE_NORETURN;
|
17
22
|
static void handle_exception(ExceptionInfo *, Image *, ErrorRetention);
|
@@ -359,7 +364,6 @@ rm_percentage(VALUE arg, double max)
|
|
359
364
|
{
|
360
365
|
double pct;
|
361
366
|
char *end;
|
362
|
-
int not_num;
|
363
367
|
|
364
368
|
if (!rm_check_num2dbl(arg))
|
365
369
|
{
|
@@ -503,7 +507,6 @@ rm_fuzz_to_dbl(VALUE fuzz_arg)
|
|
503
507
|
{
|
504
508
|
double fuzz;
|
505
509
|
char *end;
|
506
|
-
int not_num;
|
507
510
|
|
508
511
|
if (!rm_check_num2dbl(fuzz_arg))
|
509
512
|
{
|
@@ -927,7 +930,7 @@ rm_get_property(const Image *img, const char *property)
|
|
927
930
|
* No Ruby usage (internal function)
|
928
931
|
*
|
929
932
|
* @param image the image
|
930
|
-
* @param property the property name
|
933
|
+
* @param property the property name
|
931
934
|
* @param value the property value
|
932
935
|
* @return true if successful, otherwise false
|
933
936
|
*/
|
@@ -1002,7 +1005,15 @@ rm_get_optional_arguments(VALUE img)
|
|
1002
1005
|
optional_method_arguments = rb_const_get_from(Module_Magick, rb_intern("OptionalMethodArguments"));
|
1003
1006
|
argv[0] = img;
|
1004
1007
|
opt_args = rb_class_new_instance(1, argv, optional_method_arguments);
|
1005
|
-
|
1008
|
+
|
1009
|
+
if (rb_proc_arity(rb_block_proc()) == 0)
|
1010
|
+
{
|
1011
|
+
rb_obj_instance_eval(0, NULL, opt_args);
|
1012
|
+
}
|
1013
|
+
else
|
1014
|
+
{
|
1015
|
+
rb_yield(opt_args);
|
1016
|
+
}
|
1006
1017
|
}
|
1007
1018
|
|
1008
1019
|
RB_GC_GUARD(optional_method_arguments);
|
@@ -1532,14 +1543,15 @@ rm_progress_monitor(
|
|
1532
1543
|
VALUE rval;
|
1533
1544
|
VALUE method, offset, span;
|
1534
1545
|
|
1535
|
-
//
|
1536
|
-
|
1537
|
-
|
1538
|
-
// Check stack length manually instead of ruby_stack_check() for old Ruby.
|
1539
|
-
if (ruby_stack_length(NULL) > RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN)
|
1546
|
+
// Check running thread.
|
1547
|
+
if (rm_current_thread_id() != rm_main_thread_id)
|
1540
1548
|
{
|
1541
|
-
//
|
1542
|
-
//
|
1549
|
+
// ImageMagick might call back in a different thread than Ruby is running in.
|
1550
|
+
// If it is a different thread, it would not have a Ruby GVL and
|
1551
|
+
// it could not retrieve properly Ruby stack.
|
1552
|
+
|
1553
|
+
// Unfortunately, there is no API available to check if the current thread has a GVL,
|
1554
|
+
// so the thread id was checked in here.
|
1543
1555
|
return MagickTrue;
|
1544
1556
|
}
|
1545
1557
|
|
@@ -1870,3 +1882,19 @@ rm_raise_exception(ExceptionInfo *exception)
|
|
1870
1882
|
rm_magick_error(msg);
|
1871
1883
|
}
|
1872
1884
|
|
1885
|
+
/**
|
1886
|
+
* Get current thread id.
|
1887
|
+
*
|
1888
|
+
* No Ruby usage (internal function)
|
1889
|
+
*
|
1890
|
+
* @return thread id
|
1891
|
+
*/
|
1892
|
+
unsigned long long
|
1893
|
+
rm_current_thread_id()
|
1894
|
+
{
|
1895
|
+
#if defined(_WIN32)
|
1896
|
+
return (unsigned long long)GetCurrentThreadId();
|
1897
|
+
#else
|
1898
|
+
return (unsigned long long)pthread_self();
|
1899
|
+
#endif
|
1900
|
+
}
|
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.2
|
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-23 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
|
@@ -134,6 +148,7 @@ extra_rdoc_files: []
|
|
134
148
|
files:
|
135
149
|
- ".codeclimate.yml"
|
136
150
|
- ".editorconfig"
|
151
|
+
- ".github/ISSUE_TEMPLATE.md"
|
137
152
|
- ".github/workflows/ci.yml"
|
138
153
|
- ".gitignore"
|
139
154
|
- ".rspec"
|
@@ -205,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
220
|
version: '0'
|
206
221
|
requirements:
|
207
222
|
- ImageMagick 6.7.7 or later
|
208
|
-
rubygems_version: 3.
|
223
|
+
rubygems_version: 3.1.4
|
209
224
|
signing_key:
|
210
225
|
specification_version: 4
|
211
226
|
summary: Ruby binding to ImageMagick
|