rmagick 5.3.0 → 5.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.devcontainer/ImageMagick6/devcontainer.json +1 -1
- data/.devcontainer/devcontainer.json +1 -1
- data/.devcontainer/setup-user.sh +1 -1
- data/.editorconfig +1 -1
- data/.github/workflows/ci.yml +20 -16
- data/.gitignore +1 -0
- data/.yardopts +1 -1
- data/CHANGELOG.md +13 -0
- data/before_install_osx.sh +1 -1
- data/ext/RMagick/extconf.rb +19 -12
- data/ext/RMagick/{rmagick.c → rmagick.cpp} +19 -22
- data/ext/RMagick/rmagick.h +70 -49
- data/ext/RMagick/{rmdraw.c → rmdraw.cpp} +25 -24
- data/ext/RMagick/{rmenum.c → rmenum.cpp} +42 -42
- data/ext/RMagick/{rmfill.c → rmfill.cpp} +6 -6
- data/ext/RMagick/{rmilist.c → rmilist.cpp} +23 -21
- data/ext/RMagick/{rmimage.c → rmimage.cpp} +202 -157
- data/ext/RMagick/{rminfo.c → rminfo.cpp} +11 -11
- data/ext/RMagick/{rmkinfo.c → rmkinfo.cpp} +4 -9
- data/ext/RMagick/rmmain.cpp +1957 -0
- data/ext/RMagick/{rmmontage.c → rmmontage.cpp} +5 -5
- data/ext/RMagick/{rmpixel.c → rmpixel.cpp} +40 -41
- data/ext/RMagick/{rmstruct.c → rmstruct.cpp} +6 -6
- data/ext/RMagick/{rmutil.c → rmutil.cpp} +33 -13
- data/lib/rmagick/version.rb +1 -1
- data/rmagick.gemspec +1 -0
- metadata +30 -16
- data/ext/RMagick/rmmain.c +0 -1955
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbc981dbe87ea60366b54e23cbf158b40abe7c17db2f506cad561c851728bbcc
|
4
|
+
data.tar.gz: 3ed1649aad11bd5d092288ad20e5c4d50d9b3d44e129c0b168f94cfdf423693a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3bb53278c117cb808987e70bd8b09cb5ac89dd185e51684b745cf71880e876c0b0da304b24b30169c3eb53698503630d550ab3e449ce9b8a02bcbd26a3f5ca1
|
7
|
+
data.tar.gz: ff0beeeb2c91ad2e284d14f05617938bf5c7b96ef72d31fcbe9b3a5f96a217d084f60dee7fd52573be36a18689d77788951f410b2bcad6976032917e9828706b
|
data/.devcontainer/setup-user.sh
CHANGED
data/.editorconfig
CHANGED
data/.github/workflows/ci.yml
CHANGED
@@ -15,7 +15,7 @@ jobs:
|
|
15
15
|
runs-on: ubuntu-latest
|
16
16
|
timeout-minutes: 20
|
17
17
|
steps:
|
18
|
-
- uses: actions/checkout@
|
18
|
+
- uses: actions/checkout@v4
|
19
19
|
- name: Set up Ruby 2.3
|
20
20
|
uses: ruby/setup-ruby@master
|
21
21
|
with:
|
@@ -30,19 +30,24 @@ jobs:
|
|
30
30
|
timeout-minutes: 20
|
31
31
|
strategy:
|
32
32
|
matrix:
|
33
|
-
ruby-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2']
|
33
|
+
ruby-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3']
|
34
34
|
imagemagick-version:
|
35
35
|
- { full: 6.7.7-10, major-minor: '6.7' }
|
36
36
|
- { full: 6.8.9-10, major-minor: '6.8' }
|
37
|
-
- { full: 6.9.
|
37
|
+
- { full: 6.9.13-4, major-minor: '6.9' }
|
38
38
|
- { full: 7.0.11-14, major-minor: '7.0' }
|
39
|
-
- { full: 7.1.1-
|
39
|
+
- { full: 7.1.1-26, major-minor: '7.1' }
|
40
|
+
exclude:
|
41
|
+
# Ghostscript 9.55.0 causes error with Ruby 3.3 + ImageMagick 6.7 when run Magick::Draw tests.
|
42
|
+
# It disable running tests with Ruby 3.3 + ImageMagick 6.7 because it might be difficult to support old ImageMagick.
|
43
|
+
- ruby-version: '3.3'
|
44
|
+
imagemagick-version: { major-minor: '6.7' }
|
40
45
|
|
41
46
|
name: Linux, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
|
42
47
|
steps:
|
43
|
-
- uses: actions/checkout@
|
48
|
+
- uses: actions/checkout@v4
|
44
49
|
- name: Cache ImageMagick built objects
|
45
|
-
uses: actions/cache@
|
50
|
+
uses: actions/cache@v4
|
46
51
|
with:
|
47
52
|
path: ./build-ImageMagick
|
48
53
|
key: v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }}
|
@@ -66,17 +71,16 @@ jobs:
|
|
66
71
|
timeout-minutes: 20
|
67
72
|
strategy:
|
68
73
|
matrix:
|
69
|
-
ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2']
|
74
|
+
ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3']
|
70
75
|
imagemagick-version:
|
71
|
-
- { full: 6.9.
|
72
|
-
- { full: 7.
|
73
|
-
- { full: 7.1.1-7, major-minor: '7.1' }
|
76
|
+
- { full: 6.9.13-4, major-minor: '6.9' }
|
77
|
+
- { full: 7.1.1-26, major-minor: '7.1' }
|
74
78
|
|
75
79
|
name: macOS, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
|
76
80
|
steps:
|
77
|
-
- uses: actions/checkout@
|
81
|
+
- uses: actions/checkout@v4
|
78
82
|
- name: Cache ImageMagick built objects
|
79
|
-
uses: actions/cache@
|
83
|
+
uses: actions/cache@v4
|
80
84
|
with:
|
81
85
|
path: ./build-ImageMagick
|
82
86
|
key: v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }}
|
@@ -99,17 +103,17 @@ jobs:
|
|
99
103
|
timeout-minutes: 20
|
100
104
|
strategy:
|
101
105
|
matrix:
|
102
|
-
ruby-version: ['3.
|
106
|
+
ruby-version: ['3.3']
|
103
107
|
imagemagick-version:
|
104
|
-
- { full: 6.9.
|
105
|
-
- { full: 7.1.1-
|
108
|
+
- { full: 6.9.13-4, major-minor: '6.9' }
|
109
|
+
- { full: 7.1.1-26, major-minor: '7.1' }
|
106
110
|
env:
|
107
111
|
bundled_im_dir: C:\Program Files\ImageMagick-7.1.1-Q16-HDRI
|
108
112
|
install_im_dir: D:\ImageMagick
|
109
113
|
|
110
114
|
name: MSWin, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
|
111
115
|
steps:
|
112
|
-
- uses: actions/checkout@
|
116
|
+
- uses: actions/checkout@v4
|
113
117
|
- name: Setup environment variable
|
114
118
|
# https://stackoverflow.com/questions/60169752/how-to-update-the-path-in-a-github-action-workflow-file-for-a-windows-latest-hos
|
115
119
|
run: |
|
data/.gitignore
CHANGED
data/.yardopts
CHANGED
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,19 @@
|
|
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 5.4.0
|
7
|
+
|
8
|
+
Improvements
|
9
|
+
|
10
|
+
- Use rb_io_path() if exist because pathv attr was marked as deprecated at Ruby 3.3 (#1409)
|
11
|
+
- Add observer gem as dependency (#1411)
|
12
|
+
- Add aliases of filter type (#1439)
|
13
|
+
- Release GVL in Image#contrast (#1440)
|
14
|
+
|
15
|
+
Bug Fixes
|
16
|
+
|
17
|
+
- Use C++ compiler in order to fix installation error with latest ImageMagick 7 on Windows (#1433)
|
18
|
+
|
6
19
|
## RMagick 5.3.0
|
7
20
|
|
8
21
|
Improvements
|
data/before_install_osx.sh
CHANGED
data/ext/RMagick/extconf.rb
CHANGED
@@ -4,6 +4,12 @@ require 'rubygems'
|
|
4
4
|
require 'mkmf'
|
5
5
|
require 'pkg-config'
|
6
6
|
|
7
|
+
module MakeMakefile
|
8
|
+
# Use the C++ compiler to retrieve the information needed to create a Makefile.
|
9
|
+
remove_const(:CONFTEST_C)
|
10
|
+
CONFTEST_C = "#{CONFTEST}.cpp"
|
11
|
+
end
|
12
|
+
|
7
13
|
module RMagick
|
8
14
|
class Extconf
|
9
15
|
require 'rmagick/version'
|
@@ -77,7 +83,7 @@ module RMagick
|
|
77
83
|
end
|
78
84
|
|
79
85
|
def configure_headers
|
80
|
-
@headers = %w[assert.h ctype.h stdio.h stdlib.h math.h time.h sys/types.h]
|
86
|
+
@headers = %w[assert.h ctype.h stdio.h stdlib.h math.h time.h sys/types.h ruby.h ruby/io.h]
|
81
87
|
|
82
88
|
if have_header('MagickCore/MagickCore.h')
|
83
89
|
headers << 'MagickCore/MagickCore.h'
|
@@ -111,6 +117,8 @@ module RMagick
|
|
111
117
|
$LDFLAGS = "#{original_ldflags} #{ldflags}"
|
112
118
|
end
|
113
119
|
|
120
|
+
$CPPFLAGS += ' -std=c++11 -Wno-register'
|
121
|
+
|
114
122
|
configure_archflags_for_osx($magick_package) if RUBY_PLATFORM =~ /darwin/ # osx
|
115
123
|
|
116
124
|
elsif RUBY_PLATFORM =~ /mingw/ # mingw
|
@@ -120,6 +128,8 @@ module RMagick
|
|
120
128
|
$LDFLAGS += %( -L"#{dir_paths[:lib]}")
|
121
129
|
$LDFLAGS << ' -lucrt' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4.0')
|
122
130
|
|
131
|
+
$CPPFLAGS += ' -std=c++11 -Wno-register'
|
132
|
+
|
123
133
|
have_library(im_version_at_least?('7.0.0') ? 'CORE_RL_MagickCore_' : 'CORE_RL_magick_')
|
124
134
|
|
125
135
|
else # mswin
|
@@ -131,13 +141,11 @@ module RMagick
|
|
131
141
|
|
132
142
|
$LOCAL_LIBS += ' ' + (im_version_at_least?('7.0.0') ? 'CORE_RL_MagickCore_.lib' : 'CORE_RL_magick_.lib')
|
133
143
|
|
144
|
+
$CPPFLAGS += ' /std:c++11'
|
134
145
|
end
|
135
|
-
|
136
|
-
$CPPFLAGS
|
137
|
-
|
138
|
-
else
|
139
|
-
' -std=c99'
|
140
|
-
end
|
146
|
+
ruby_version = RUBY_VERSION.split('.')
|
147
|
+
$CPPFLAGS += " -DRUBY_VERSION_MAJOR=#{ruby_version[0]} -DRUBY_VERSION_MINOR=#{ruby_version[1]}"
|
148
|
+
$CPPFLAGS += ' $(optflags) $(debugflags)'
|
141
149
|
end
|
142
150
|
|
143
151
|
def exit_failure(msg)
|
@@ -305,10 +313,8 @@ module RMagick
|
|
305
313
|
exit_failure <<~END_MINGW
|
306
314
|
Can't install RMagick #{RMAGICK_VERS}.
|
307
315
|
Can't find the ImageMagick library.
|
308
|
-
|
309
|
-
|
310
|
-
e.g.
|
311
|
-
gem install rmagick -- '--with-opt-dir=\"C:\\Program Files\\ImageMagick-6.9.1-Q16\"'
|
316
|
+
|
317
|
+
Please check PATH environment variable for ImageMagick installation path.
|
312
318
|
END_MINGW
|
313
319
|
end
|
314
320
|
|
@@ -361,7 +367,8 @@ module RMagick
|
|
361
367
|
def create_header_file
|
362
368
|
ruby_api = [
|
363
369
|
'rb_gc_adjust_memory_usage', # Ruby 2.4.0
|
364
|
-
'rb_gc_mark_movable' # Ruby 2.7.0
|
370
|
+
'rb_gc_mark_movable', # Ruby 2.7.0
|
371
|
+
'rb_io_path' # Ruby 3.2.0
|
365
372
|
]
|
366
373
|
memory_api = %w[
|
367
374
|
posix_memalign
|
@@ -5,8 +5,8 @@
|
|
5
5
|
*
|
6
6
|
* Changes since Nov. 2009 copyright © by Benjamin Thomas and Omer Bar-or
|
7
7
|
*
|
8
|
-
* @file rmagick.
|
9
|
-
* @version $Id: rmagick.
|
8
|
+
* @file rmagick.cpp
|
9
|
+
* @version $Id: rmagick.cpp,v 1.4 2009/12/20 02:33:32 baror Exp $
|
10
10
|
* @author Tim Hunter
|
11
11
|
******************************************************************************/
|
12
12
|
|
@@ -14,8 +14,6 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
-
static VALUE rm_yield_handle_exception(VALUE, VALUE) ATTRIBUTE_NORETURN;
|
18
|
-
|
19
17
|
static VALUE
|
20
18
|
rm_yield_body(VALUE object)
|
21
19
|
{
|
@@ -42,7 +40,7 @@ rm_yield_handle_exception(VALUE allocated_area, VALUE exc)
|
|
42
40
|
*
|
43
41
|
*/
|
44
42
|
VALUE
|
45
|
-
Magick_colors(VALUE
|
43
|
+
Magick_colors(VALUE klass)
|
46
44
|
{
|
47
45
|
const ColorInfo **color_info_list;
|
48
46
|
size_t number_colors, x;
|
@@ -60,10 +58,10 @@ Magick_colors(VALUE class)
|
|
60
58
|
{
|
61
59
|
for (x = 0; x < number_colors; x++)
|
62
60
|
{
|
63
|
-
rb_rescue(rm_yield_body, Import_ColorInfo(color_info_list[x]), rm_yield_handle_exception, (VALUE)color_info_list);
|
61
|
+
rb_rescue(RESCUE_FUNC(rm_yield_body), Import_ColorInfo(color_info_list[x]), RESCUE_EXCEPTION_HANDLER_FUNC(rm_yield_handle_exception), (VALUE)color_info_list);
|
64
62
|
}
|
65
63
|
magick_free((void *)color_info_list);
|
66
|
-
return
|
64
|
+
return klass;
|
67
65
|
}
|
68
66
|
else
|
69
67
|
{
|
@@ -93,7 +91,7 @@ Magick_colors(VALUE class)
|
|
93
91
|
*
|
94
92
|
*/
|
95
93
|
VALUE
|
96
|
-
Magick_fonts(VALUE
|
94
|
+
Magick_fonts(VALUE klass)
|
97
95
|
{
|
98
96
|
const TypeInfo **type_info;
|
99
97
|
size_t number_types, x;
|
@@ -109,10 +107,10 @@ Magick_fonts(VALUE class)
|
|
109
107
|
{
|
110
108
|
for (x = 0; x < number_types; x++)
|
111
109
|
{
|
112
|
-
rb_rescue(rm_yield_body, Import_TypeInfo((const TypeInfo *)type_info[x]), rm_yield_handle_exception, (VALUE)type_info);
|
110
|
+
rb_rescue(RESCUE_FUNC(rm_yield_body), Import_TypeInfo((const TypeInfo *)type_info[x]), RESCUE_EXCEPTION_HANDLER_FUNC(rm_yield_handle_exception), (VALUE)type_info);
|
113
111
|
}
|
114
112
|
magick_free((void *)type_info);
|
115
|
-
return
|
113
|
+
return klass;
|
116
114
|
}
|
117
115
|
else
|
118
116
|
{
|
@@ -170,7 +168,7 @@ MagickInfo_to_format(const MagickInfo *magick_info)
|
|
170
168
|
* @return [Hash] the formats hash.
|
171
169
|
*/
|
172
170
|
VALUE
|
173
|
-
Magick_init_formats(VALUE
|
171
|
+
Magick_init_formats(VALUE klass ATTRIBUTE_UNUSED)
|
174
172
|
{
|
175
173
|
const MagickInfo **magick_info;
|
176
174
|
size_t number_formats, x;
|
@@ -210,11 +208,11 @@ Magick_init_formats(VALUE class ATTRIBUTE_UNUSED)
|
|
210
208
|
* Set resource limits.
|
211
209
|
* @param resource [String, Symbol] the type of resource
|
212
210
|
* @param limit [Numeric] the new limit number
|
213
|
-
*
|
211
|
+
*
|
214
212
|
* @return [Numeric] the old limit.
|
215
213
|
*/
|
216
214
|
VALUE
|
217
|
-
Magick_limit_resource(int argc, VALUE *argv, VALUE
|
215
|
+
Magick_limit_resource(int argc, VALUE *argv, VALUE klass)
|
218
216
|
{
|
219
217
|
VALUE resource, limit;
|
220
218
|
ResourceType res = UndefinedResource;
|
@@ -227,7 +225,7 @@ Magick_limit_resource(int argc, VALUE *argv, VALUE class)
|
|
227
225
|
switch (TYPE(resource))
|
228
226
|
{
|
229
227
|
case T_NIL:
|
230
|
-
return
|
228
|
+
return klass;
|
231
229
|
|
232
230
|
case T_SYMBOL:
|
233
231
|
id = (ID)SYM2ID(resource);
|
@@ -265,7 +263,7 @@ Magick_limit_resource(int argc, VALUE *argv, VALUE class)
|
|
265
263
|
str = StringValueCStr(resource);
|
266
264
|
if (*str == '\0')
|
267
265
|
{
|
268
|
-
return
|
266
|
+
return klass;
|
269
267
|
}
|
270
268
|
else if (rm_strcasecmp("area", str) == 0)
|
271
269
|
{
|
@@ -321,12 +319,12 @@ Magick_limit_resource(int argc, VALUE *argv, VALUE class)
|
|
321
319
|
* @param threshold [Numeric] the number of megabytes to set.
|
322
320
|
*/
|
323
321
|
VALUE
|
324
|
-
Magick_set_cache_threshold(VALUE
|
322
|
+
Magick_set_cache_threshold(VALUE klass, VALUE threshold)
|
325
323
|
{
|
326
324
|
unsigned long thrshld = NUM2ULONG(threshold);
|
327
325
|
SetMagickResourceLimit(MemoryResource, (MagickSizeType)thrshld);
|
328
326
|
SetMagickResourceLimit(MapResource, (MagickSizeType)(2*thrshld));
|
329
|
-
return
|
327
|
+
return klass;
|
330
328
|
}
|
331
329
|
|
332
330
|
|
@@ -354,7 +352,7 @@ Magick_set_cache_threshold(VALUE class, VALUE threshold)
|
|
354
352
|
* @param args [String] the mask of log event.
|
355
353
|
*/
|
356
354
|
VALUE
|
357
|
-
Magick_set_log_event_mask(int argc, VALUE *argv, VALUE
|
355
|
+
Magick_set_log_event_mask(int argc, VALUE *argv, VALUE klass)
|
358
356
|
{
|
359
357
|
int x;
|
360
358
|
|
@@ -366,7 +364,7 @@ Magick_set_log_event_mask(int argc, VALUE *argv, VALUE class)
|
|
366
364
|
{
|
367
365
|
SetLogEventMask(StringValueCStr(argv[x]));
|
368
366
|
}
|
369
|
-
return
|
367
|
+
return klass;
|
370
368
|
}
|
371
369
|
|
372
370
|
/**
|
@@ -388,9 +386,8 @@ Magick_set_log_event_mask(int argc, VALUE *argv, VALUE class)
|
|
388
386
|
* @param format [String] the format to set.
|
389
387
|
*/
|
390
388
|
VALUE
|
391
|
-
Magick_set_log_format(VALUE
|
389
|
+
Magick_set_log_format(VALUE klass, VALUE format)
|
392
390
|
{
|
393
391
|
SetLogFormat(StringValueCStr(format));
|
394
|
-
return
|
392
|
+
return klass;
|
395
393
|
}
|
396
|
-
|