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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb6efb1cd1084ddfa7fcf81fa760b652ff8c2cf02609da08744931b71bfa5af9
4
- data.tar.gz: 66a715d679ea9114f0525cdd5ee60643b8fb84f9f96548a1d82a27e8fc9d0821
3
+ metadata.gz: bbc981dbe87ea60366b54e23cbf158b40abe7c17db2f506cad561c851728bbcc
4
+ data.tar.gz: 3ed1649aad11bd5d092288ad20e5c4d50d9b3d44e129c0b168f94cfdf423693a
5
5
  SHA512:
6
- metadata.gz: '057860ced79ea3612eaae3df6840c57833da74b4eb25ddca45da7d40bf6577cbc6288b1a807dc9c9f8aeb6b0a652f3fe13007166fac2094ec9e75b59e170adf4'
7
- data.tar.gz: df562bbda78354a5b595c2494ce6971b6a51c068df580cebd22c9accfb99c73f12ecaf55ab8c9b4f7f25a2cd05530a9b53af77fc29791ee9825bd6ef6b82320a
6
+ metadata.gz: f3bb53278c117cb808987e70bd8b09cb5ac89dd185e51684b745cf71880e876c0b0da304b24b30169c3eb53698503630d550ab3e449ce9b8a02bcbd26a3f5ca1
7
+ data.tar.gz: ff0beeeb2c91ad2e284d14f05617938bf5c7b96ef72d31fcbe9b3a5f96a217d084f60dee7fd52573be36a18689d77788951f410b2bcad6976032917e9828706b
@@ -4,7 +4,7 @@
4
4
  "dockerfile": "../Dockerfile",
5
5
  "args": {
6
6
  "RUBY_VERSION": "3.1.2",
7
- "IMAGEMAGICK_VERSION": "6.9.12-85"
7
+ "IMAGEMAGICK_VERSION": "6.9.13-4"
8
8
  }
9
9
  },
10
10
  "onCreateCommand": "/setup/setup-repo.sh"
@@ -4,7 +4,7 @@
4
4
  "dockerfile": "Dockerfile",
5
5
  "args": {
6
6
  "RUBY_VERSION": "3.1.2",
7
- "IMAGEMAGICK_VERSION": "7.1.1-7"
7
+ "IMAGEMAGICK_VERSION": "7.1.1-26"
8
8
  }
9
9
  },
10
10
  "onCreateCommand": "/setup/setup-repo.sh"
@@ -42,4 +42,4 @@ __show_notice
42
42
  EOF
43
43
  )"
44
44
 
45
- echo "${codespaces_bash}" >> "/root/.bashrc"
45
+ echo "${codespaces_bash}" >> "/root/.bashrc"
data/.editorconfig CHANGED
@@ -13,5 +13,5 @@ tab_width = 2
13
13
  [{*.{rb,yml,sh,md}]
14
14
  indent_size = 2
15
15
 
16
- [*.c]
16
+ [*.cpp]
17
17
  indent_size = 4
@@ -15,7 +15,7 @@ jobs:
15
15
  runs-on: ubuntu-latest
16
16
  timeout-minutes: 20
17
17
  steps:
18
- - uses: actions/checkout@v3
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.12-85, major-minor: '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-7, major-minor: '7.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@v3
48
+ - uses: actions/checkout@v4
44
49
  - name: Cache ImageMagick built objects
45
- uses: actions/cache@v3
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.12-85, major-minor: '6.9' }
72
- - { full: 7.0.11-14, major-minor: '7.0' }
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@v3
81
+ - uses: actions/checkout@v4
78
82
  - name: Cache ImageMagick built objects
79
- uses: actions/cache@v3
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.2']
106
+ ruby-version: ['3.3']
103
107
  imagemagick-version:
104
- - { full: 6.9.12-85, major-minor: '6.9' }
105
- - { full: 7.1.1-7, major-minor: '7.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@v3
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
@@ -20,6 +20,7 @@ tmp
20
20
  *.o
21
21
  *.a
22
22
  *.log
23
+ *.def
23
24
  Makefile
24
25
  extconf.h
25
26
  build-ImageMagick/
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
2
  lib/**/*.rb
3
- ext/**/*.c
3
+ ext/**/*.cpp
4
4
  *.md
5
5
  LICENSE
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
@@ -43,7 +43,7 @@ build_imagemagick() {
43
43
  fi
44
44
 
45
45
  cd "${build_dir}"
46
- ./configure --prefix=/usr/local "${options}" --without-raw
46
+ ./configure --prefix=/usr/local "${options}" --without-raw --without-jxl
47
47
  make -j
48
48
  }
49
49
 
@@ -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 << if have_macro('__GNUC__')
137
- ' -std=gnu99 -Wno-void-pointer-to-int-cast -Wno-void-pointer-to-enum-cast -Wno-pointer-to-int-cast'
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
- Retry with '--with-opt-dir' option.
309
- Usage: gem install rmagick -- '--with-opt-dir=\"[path to ImageMagick]\"'
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 &copy; by Benjamin Thomas and Omer Bar-or
7
7
  *
8
- * @file rmagick.c
9
- * @version $Id: rmagick.c,v 1.4 2009/12/20 02:33:32 baror Exp $
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 class)
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 class;
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 class)
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 class;
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 class ATTRIBUTE_UNUSED)
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 class)
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 class;
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 class;
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 class, VALUE threshold)
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 class;
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 class)
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 class;
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 class, VALUE format)
389
+ Magick_set_log_format(VALUE klass, VALUE format)
392
390
  {
393
391
  SetLogFormat(StringValueCStr(format));
394
- return class;
392
+ return klass;
395
393
  }
396
-