rmagick 6.3.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/Gemfile +3 -6
  4. data/README.md +49 -70
  5. data/Rakefile +1 -8
  6. data/ext/RMagick/extconf.rb +10 -40
  7. data/ext/RMagick/rmagick.cpp +6 -7
  8. data/ext/RMagick/rmagick.h +5 -18
  9. data/ext/RMagick/rmdraw.cpp +6 -7
  10. data/ext/RMagick/rmenum.cpp +5 -6
  11. data/ext/RMagick/rmfill.cpp +6 -8
  12. data/ext/RMagick/rmilist.cpp +6 -7
  13. data/ext/RMagick/rmimage.cpp +55 -109
  14. data/ext/RMagick/rminfo.cpp +6 -8
  15. data/ext/RMagick/rmkinfo.cpp +8 -7
  16. data/ext/RMagick/rmmain.cpp +7 -23
  17. data/ext/RMagick/rmmontage.cpp +6 -8
  18. data/ext/RMagick/rmpixel.cpp +6 -7
  19. data/ext/RMagick/rmstruct.cpp +8 -12
  20. data/ext/RMagick/rmutil.cpp +6 -27
  21. data/lib/rmagick/version.rb +4 -3
  22. data/lib/rmagick_internal.rb +30 -37
  23. data/lib/rvg/clippath.rb +3 -4
  24. data/lib/rvg/container.rb +3 -4
  25. data/lib/rvg/deep_equal.rb +3 -0
  26. data/lib/rvg/describable.rb +4 -5
  27. data/lib/rvg/embellishable.rb +7 -8
  28. data/lib/rvg/misc.rb +13 -12
  29. data/lib/rvg/paint.rb +3 -4
  30. data/lib/rvg/pathdata.rb +3 -4
  31. data/lib/rvg/rvg.rb +3 -29
  32. data/lib/rvg/stretchable.rb +4 -5
  33. data/lib/rvg/stylable.rb +4 -5
  34. data/lib/rvg/text.rb +9 -10
  35. data/lib/rvg/transformable.rb +3 -4
  36. data/lib/rvg/units.rb +3 -2
  37. data/rmagick.gemspec +6 -4
  38. data/sig/rmagick.rbs +2 -1
  39. metadata +4 -19
  40. data/.devcontainer/Dockerfile +0 -14
  41. data/.devcontainer/ImageMagick6/devcontainer.json +0 -11
  42. data/.devcontainer/devcontainer.json +0 -11
  43. data/.devcontainer/setup-repo.sh +0 -10
  44. data/.devcontainer/setup-user.sh +0 -45
  45. data/.editorconfig +0 -17
  46. data/.github/ISSUE_TEMPLATE/report.yml +0 -40
  47. data/.github/dependabot.yml +0 -6
  48. data/.github/workflows/ci.yml +0 -237
  49. data/.gitignore +0 -29
  50. data/.rspec +0 -2
  51. data/.rubocop.yml +0 -68
  52. data/.rubocop_todo.yml +0 -594
  53. data/before_install_linux.sh +0 -61
  54. data/before_install_osx.sh +0 -60
@@ -1,10 +0,0 @@
1
- #!/bin/bash
2
- set -e
3
-
4
- apt-get update
5
- apt-get install sudo
6
-
7
- bash /workspaces/rmagick/before_install_linux.sh
8
-
9
- cd /workspaces/rmagick
10
- bundle install --path=vendor/bundle --jobs 4 --retry 3
@@ -1,45 +0,0 @@
1
- #!/bin/bash
2
- set -e
3
-
4
- codespaces_bash="$(cat \
5
- <<'EOF'
6
- # Codespaces bash prompt theme
7
- __bash_prompt() {
8
- local userpart='`export XIT=$? \
9
- && [ ! -z "${GITHUB_USER}" ] && echo -n "\[\033[0;32m\]@${GITHUB_USER} " || echo -n "\[\033[0;32m\]\u " \
10
- && echo -n "\[\033[0;36m\][IM ${IMAGEMAGICK_VERSION}]" \
11
- && [ "$XIT" -ne "0" ] && echo -n "\[\033[1;31m\]➜" || echo -n "\[\033[0m\]➜"`'
12
- local gitbranch='`\
13
- if [ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ]; then \
14
- export BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD 2>/dev/null); \
15
- if [ "${BRANCH}" != "" ]; then \
16
- echo -n "\[\033[0;36m\](\[\033[1;31m\]${BRANCH}" \
17
- && if git ls-files --error-unmatch -m --directory --no-empty-directory -o --exclude-standard ":/*" > /dev/null 2>&1; then \
18
- echo -n " \[\033[1;33m\]✗"; \
19
- fi \
20
- && echo -n "\[\033[0;36m\]) "; \
21
- fi; \
22
- fi`'
23
- local lightblue='\[\033[1;34m\]'
24
- local removecolor='\[\033[0m\]'
25
- PS1="${userpart} ${lightblue}\w ${gitbranch}${removecolor}\$ "
26
- unset -f __bash_prompt
27
- }
28
- __bash_prompt
29
-
30
- __show_notice() {
31
- local __message="
32
- \033[0;32mWelcome to Codespaces! You are using the pre-configured rmagick image.\033[0m
33
-
34
- \033[0;35mTests can be executed with:\033[0m bundle exec rake
35
- \033[0;35mCode style can be checked with:\033[0m STYLE_CHECKS=true bundle exec rubocop
36
- "
37
- echo -e "$__message"
38
-
39
- unset -f __show_notice
40
- }
41
- __show_notice
42
- EOF
43
- )"
44
-
45
- echo "${codespaces_bash}" >> "/root/.bashrc"
data/.editorconfig DELETED
@@ -1,17 +0,0 @@
1
- # EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
2
- # @see http://editorconfig.org
3
- root = true
4
-
5
- [*]
6
- end_of_line = lf
7
- charset = utf-8
8
- trim_trailing_whitespace = true
9
- insert_final_newline = true
10
- indent_style = space
11
- tab_width = 2
12
-
13
- [*.{rb,yml,sh,md}]
14
- indent_size = 2
15
-
16
- [*.cpp]
17
- indent_size = 4
@@ -1,40 +0,0 @@
1
- name: Report
2
- description: Create a report.
3
- body:
4
- - type: textarea
5
- id: description
6
- attributes:
7
- label: Description
8
- description: A description of the bug or feature.
9
- validations:
10
- required: true
11
- - type: textarea
12
- id: reproduce
13
- attributes:
14
- label: Steps to Reproduce
15
- description: |
16
- List of steps, sample code, failing test or link to a project that reproduces the behavior.
17
- Make sure you place a stack trace inside a code (```) block to avoid linking unrelated issues.
18
- validations:
19
- required: true
20
- - type: textarea
21
- id: environment
22
- attributes:
23
- label: System Configuration
24
- description: Tell us about the environment where you are experiencing the bug.
25
- value: |
26
- - ImageMagick version:
27
- - RMagick version:
28
- - Ruby version:
29
- - Environment (Operating system, version and so on):
30
- - Additional information:
31
- render: markdown
32
- validations:
33
- required: true
34
- - type: textarea
35
- id: addtional-context
36
- attributes:
37
- label: Additional context
38
- description: Add any other context about the problem here.
39
- validations:
40
- required: false
@@ -1,6 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: 'github-actions'
4
- directory: '/'
5
- schedule:
6
- interval: 'monthly'
@@ -1,237 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
- pull_request:
8
- workflow_dispatch:
9
-
10
- permissions:
11
- contents: read
12
-
13
- jobs:
14
- lint:
15
- runs-on: ubuntu-latest
16
- timeout-minutes: 20
17
- steps:
18
- - uses: actions/checkout@v6
19
- - name: Set up Ruby 4.0
20
- uses: ruby/setup-ruby@v1
21
- with:
22
- ruby-version: '4.0'
23
- bundler-cache: true
24
- - name: Build and test with Rake
25
- run: |
26
- STYLE_CHECKS=true bundle exec rubocop
27
-
28
- rbs:
29
- runs-on: ubuntu-latest
30
- name: RBS
31
- timeout-minutes: 20
32
- steps:
33
- - uses: actions/checkout@v6
34
- - name: Set up Ruby 4.0
35
- uses: ruby/setup-ruby@v1
36
- with:
37
- ruby-version: '4.0'
38
- bundler-cache: true
39
- - name: Validate RBS signatures
40
- run: |
41
- bundle exec rake rbs:validate && bundle exec steep check
42
-
43
- # Seems that old imagemagick depend on ghostscript 9.x for handling fonts.
44
- # However, ubuntu 24.04 has ghostscript 10.x, which is too new for old imagemagick.
45
- test-linux-for-old-imagemagick:
46
- runs-on: ubuntu-22.04
47
- timeout-minutes: 20
48
- strategy:
49
- fail-fast: false
50
- matrix:
51
- ruby-version: ['3.0']
52
- imagemagick-version:
53
- - { full: 6.8.9-10, major-minor: '6.8' }
54
- - { full: 7.0.11-14, major-minor: '7.0' }
55
-
56
- name: Linux, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
57
- steps:
58
- - uses: actions/checkout@v6
59
- - name: Cache ImageMagick built objects
60
- uses: actions/cache@v5
61
- with:
62
- path: ./build-ImageMagick
63
- key: v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }}
64
- restore-keys: |
65
- v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }}
66
- - name: Update/Install packages
67
- run: |
68
- IMAGEMAGICK_VERSION=${{ matrix.imagemagick-version.full }} ./before_install_linux.sh
69
- - name: Set up Ruby ${{ matrix.ruby-version }}
70
- uses: ruby/setup-ruby@v1
71
- with:
72
- ruby-version: ${{ matrix.ruby-version }}
73
- bundler-cache: true
74
- - name: Build and test with Rake
75
- run: |
76
- bundle exec rake
77
-
78
- test:
79
- runs-on: ${{ matrix.os }}
80
- timeout-minutes: 20
81
- strategy:
82
- fail-fast: false
83
- matrix:
84
- os:
85
- - ubuntu-latest
86
- - macos-latest
87
- ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4', '4.0']
88
- imagemagick-version:
89
- - { full: 6.9.13-43, major-minor: '6.9' }
90
- - { full: 7.1.2-18, major-minor: '7.1' }
91
-
92
- name: ${{ matrix.os }}, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
93
- steps:
94
- - uses: actions/checkout@v6
95
- - name: Cache ImageMagick built objects
96
- uses: actions/cache@v5
97
- with:
98
- path: ./build-ImageMagick
99
- key: v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }}
100
- restore-keys: |
101
- v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }}
102
- - name: Update/Install packages (Linux)
103
- if: runner.os == 'Linux'
104
- run: |
105
- IMAGEMAGICK_VERSION=${{ matrix.imagemagick-version.full }} ./before_install_linux.sh
106
- - name: Update/Install packages (macOS)
107
- if: runner.os == 'macOS'
108
- run: |
109
- IMAGEMAGICK_VERSION=${{ matrix.imagemagick-version.full }} ./before_install_osx.sh
110
- - name: Set up Ruby ${{ matrix.ruby-version }}
111
- uses: ruby/setup-ruby@v1
112
- with:
113
- ruby-version: ${{ matrix.ruby-version }}
114
- bundler-cache: true
115
- - name: Build and test with Rake
116
- run: |
117
- bundle exec rake
118
-
119
- test-windows:
120
- runs-on: ${{ matrix.os.target }}
121
- timeout-minutes: 20
122
- strategy:
123
- fail-fast: false
124
- matrix:
125
- ruby-version: ['4.0']
126
- imagemagick-version:
127
- - { full: 6.9.13-43, major-minor: '6.9' }
128
- - { full: 7.1.2-18, major-minor: '7.1' }
129
- os:
130
- - { target: windows-latest, arch: 'x64' }
131
- - { target: windows-11-arm, arch: 'arm64' }
132
- exclude:
133
- # ImageMagick 6 has not provided ARM binary. Ref. https://legacy.imagemagick.org/archive/binaries/
134
- - imagemagick-version: { full: 6.9.13-43, major-minor: '6.9' }
135
- os: { target: windows-11-arm, arch: 'arm64' }
136
-
137
- env:
138
- install_im_dir: C:\ImageMagick
139
- install_gs_dir: C:\Ghostscript
140
-
141
- name: MSWin ${{ matrix.os.arch }}, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
142
- steps:
143
- - uses: actions/checkout@v6
144
- - name: Setup environment variable
145
- # https://stackoverflow.com/questions/60169752/how-to-update-the-path-in-a-github-action-workflow-file-for-a-windows-latest-hos
146
- run: |
147
- Add-Content $env:GITHUB_PATH ${{ env.install_im_dir }}
148
- Add-Content $env:GITHUB_PATH ${{ env.install_gs_dir }}\bin
149
- - name: Install Ghostscript
150
- shell: powershell
151
- run: |
152
- $url = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs10060/gs10060w64.exe"
153
- $installer = "$env:TEMP\gs_installer.exe"
154
-
155
- Write-Host "Downloading Ghostscript..."
156
- Invoke-WebRequest -Uri $url -OutFile $installer
157
-
158
- 7z x $installer -o${{ env.install_gs_dir }} -y
159
- - name: Uninstall bundled ImageMagick
160
- # Bundled ImageMagick does not have C/C++ library and dll which required by rmagick.
161
- shell: powershell
162
- run: |
163
- $regPaths = @(
164
- "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*",
165
- "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
166
- )
167
-
168
- # Search for ImageMagick installation entry from registry
169
- $target = Get-ItemProperty $regPaths -ErrorAction SilentlyContinue |
170
- Where-Object { $_.DisplayName -like "*ImageMagick*" } |
171
- Select-Object -First 1
172
-
173
- if ($target) {
174
- Write-Host "Found installed ImageMagick: $($target.DisplayName)"
175
-
176
- $uninstallCommand = $target.UninstallString -replace '"', ''
177
-
178
- if (Test-Path $uninstallCommand) {
179
- Write-Host "Running uninstaller: $uninstallCommand"
180
- Start-Process -FilePath $uninstallCommand -ArgumentList "/VERYSILENT", "/NORESTART" -Wait
181
- Write-Host "Uninstallation completed."
182
- } else {
183
- Write-Error "Uninstaller file not found at: $uninstallCommand"
184
- }
185
- } else {
186
- Write-Host "ImageMagick is not installed (Registry check). Skipping."
187
- }
188
- - name: Install ImageMagick
189
- # https://github.com/rmagick/ImageMagick-binaries
190
- run: |
191
- $imagemagick_version = "${{ matrix.imagemagick-version.full }}"
192
- $arch = "${{ matrix.os.arch }}"
193
- $installer_name = "ImageMagick-$($imagemagick_version)-Q16-$($arch)-dll.exe"
194
- $url = "https://github.com/rmagick/ImageMagick-binaries/raw/main/$($installer_name)"
195
- Invoke-WebRequest -Uri $url -OutFile $installer_name
196
- Start-Process -FilePath $installer_name -ArgumentList "/DIR=${{ env.install_im_dir }} /VERYSILENT /NORESTART /TASKS=install_Devel"
197
- - name: Set up Ruby ${{ matrix.ruby-version }}
198
- uses: ruby/setup-ruby@v1
199
- with:
200
- ruby-version: ${{ matrix.ruby-version }}
201
- bundler-cache: true
202
- - name: Build and test with Rake
203
- run: |
204
- cmd.exe /D /S /C "bundle exec rake"
205
-
206
- test-windows-pkgconfig:
207
- runs-on: ${{ matrix.os.target }}
208
- timeout-minutes: 20
209
- strategy:
210
- fail-fast: false
211
- matrix:
212
- ruby-version: ['4.0']
213
- os:
214
- - { target: windows-latest, arch: 'x64' }
215
- - { target: windows-11-arm, arch: 'arm64' }
216
- env:
217
- RMAGICK_SKIP_GHOSTSCRIPT_TEST: "true" # To avoid the tedious Ghostscript setup
218
-
219
- name: MSWin ${{ matrix.os.arch }}, Ruby ${{ matrix.ruby-version }}, MSYS2 IM
220
- steps:
221
- - uses: actions/checkout@v6
222
- - name: Set up Ruby ${{ matrix.ruby-version }}
223
- uses: ruby/setup-ruby@v1
224
- with:
225
- ruby-version: ${{ matrix.ruby-version }}
226
- bundler-cache: true
227
- - name: Install ImageMagick
228
- run: |
229
- if ("${{ matrix.os.arch }}" -eq "arm64") {
230
- $pkg = "mingw-w64-clang-aarch64-imagemagick"
231
- } else {
232
- $pkg = "mingw-w64-ucrt-x86_64-imagemagick"
233
- }
234
- ridk exec pacman -S $pkg --noconfirm
235
- - name: Build test
236
- run: |
237
- cmd.exe /D /S /C "bundle exec rake compile"
data/.gitignore DELETED
@@ -1,29 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- lib/bundler/man
11
- pkg
12
- rdoc
13
- spec/reports
14
- test/tmp
15
- test/version_tmp
16
- vendor/bundle
17
- tmp
18
- *.bundle
19
- *.so
20
- *.o
21
- *.a
22
- *.log
23
- *.def
24
- Makefile
25
- extconf.h
26
- compile_flags.txt
27
- build-ImageMagick/
28
- doc/node_modules/
29
- doc/package-lock.json
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --require spec_helper
2
- --force-color
data/.rubocop.yml DELETED
@@ -1,68 +0,0 @@
1
- inherit_from:
2
- - .rubocop_todo.yml
3
-
4
- plugins:
5
- - rubocop-rspec
6
- - rubocop-performance
7
- - rubocop-on-rbs
8
-
9
- AllCops:
10
- DefaultFormatter: fuubar
11
- EnabledByDefault: true
12
- TargetRubyVersion: 3.0
13
- Exclude:
14
- - 'vendor/bundle/**/*'
15
- - '**/*\.spec'
16
-
17
- ################################################################################
18
- #
19
- # Rules that depart from rubocop defaults
20
- #
21
- ################################################################################
22
-
23
- Layout/MultilineAssignmentLayout:
24
- EnforcedStyle: same_line
25
-
26
- Style/FormatString:
27
- EnforcedStyle: sprintf
28
-
29
- Style/GuardClause:
30
- MinBodyLength: 3
31
-
32
- # we may not need this after finishing RSpec conversion
33
- # seems like `rubocop-rspec` already excludes the `spec/` directory
34
- Style/MethodCalledOnDoEndBlock:
35
- Exclude: [spec/**/*.rb]
36
-
37
- Style/NumericLiterals:
38
- MinDigits: 6
39
-
40
- Style/TopLevelMethodDefinition:
41
- Exclude: [doc/**/*.rb, examples/**/*.rb, spec/**/*.rb]
42
-
43
- RSpec/BeNil:
44
- EnforcedStyle: be
45
-
46
- RSpec/ClassCheck:
47
- EnforcedStyle: be_kind_of
48
-
49
- ################################################################################
50
- #
51
- # Rules we don't want to enable
52
- #
53
- ################################################################################
54
-
55
- RSpec/AlignLeftLetBrace:
56
- Enabled: false
57
-
58
- RSpec/AlignRightLetBrace:
59
- Enabled: false
60
-
61
- Style/Copyright:
62
- Enabled: false
63
-
64
- Style/DisableCopsWithinSourceCodeDirective:
65
- Enabled: false
66
-
67
- Style/AccessorGrouping:
68
- Enabled: false