rmagick 5.3.0 → 5.4.4

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: 6fd768daa5bf84d7e835a4c300d57f6826b3fd86820dd3048a12d73db62ec89f
4
+ data.tar.gz: b7afe50d7396365282e6d5e8ff7b8a6c2b0e91e7f1e2d9562d1078dd26bda7a4
5
5
  SHA512:
6
- metadata.gz: '057860ced79ea3612eaae3df6840c57833da74b4eb25ddca45da7d40bf6577cbc6288b1a807dc9c9f8aeb6b0a652f3fe13007166fac2094ec9e75b59e170adf4'
7
- data.tar.gz: df562bbda78354a5b595c2494ce6971b6a51c068df580cebd22c9accfb99c73f12ecaf55ab8c9b4f7f25a2cd05530a9b53af77fc29791ee9825bd6ef6b82320a
6
+ metadata.gz: 23b6376b8c659276107e35c4e58428bc68a4cd8d2d24830ee27c99a83dea0349516af72bf8746a9064f115d35ae3e2f8affa376c6b6ec77d8b7a89aa7ddede8c
7
+ data.tar.gz: 7633f97e950e07f2381f25d1a181b427408fa8e46790b0506c31d83d029f58f5098a073446d659d82a05988c20848f60a37fbfe5759340a8613da87bdbc53cae
@@ -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,44 @@
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.4
7
+
8
+ Bug Fixes
9
+
10
+ - Fix installation error again in some environment at creatint Makefile (#1465)
11
+ - Fix Pixel#<=> which should accept other class instance (#1463)
12
+
13
+ ## RMagick 5.4.3
14
+
15
+ Bug Fixes
16
+
17
+ - Fix installation error in some environment by using x flag to use C++ compiler in order to create Makefile (#1460)
18
+
19
+ ## RMagick 5.4.2
20
+
21
+ Improvements
22
+
23
+ - Check C++ compiler exists (#1453)
24
+
25
+ ## RMagick 5.4.1
26
+
27
+ Bug Fixes
28
+
29
+ - Fix invalid cast between different size variables (#1448)
30
+
31
+ ## RMagick 5.4.0
32
+
33
+ Improvements
34
+
35
+ - Use rb_io_path() if exist because pathv attr was marked as deprecated at Ruby 3.3 (#1409)
36
+ - Add observer gem as dependency (#1411)
37
+ - Add aliases of filter type (#1439)
38
+ - Release GVL in Image#contrast (#1440)
39
+
40
+ Bug Fixes
41
+
42
+ - Use C++ compiler in order to fix installation error with latest ImageMagick 7 on Windows (#1433)
43
+
6
44
  ## RMagick 5.3.0
7
45
 
8
46
  Improvements
data/README.md CHANGED
@@ -38,6 +38,9 @@ These prerequisites are required for the latest version of RMagick.
38
38
  - Windows
39
39
  - Other \*nix-like systems
40
40
 
41
+ **C++ compiler**
42
+ - RMagick 5.4.0 or later requires a C++ compiler.
43
+
41
44
  **Ruby**
42
45
  - Version 2.3 or later.
43
46
 
@@ -63,7 +66,7 @@ sudo apt-get install libmagickwand-dev
63
66
  On Centos, you can run:
64
67
 
65
68
  ```sh
66
- sudo yum install gcc ImageMagick-devel make which
69
+ sudo yum install ImageMagick-devel
67
70
  ```
68
71
 
69
72
  #### Arch Linux
@@ -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 for mswin environment.
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'
@@ -103,7 +109,8 @@ module RMagick
103
109
 
104
110
  # Save flags
105
111
  $CPPFLAGS += " #{ENV['CPPFLAGS']} " + PKGConfig.cflags($magick_package).chomp
106
- $LOCAL_LIBS += " #{ENV['LIBS']} " + PKGConfig.libs($magick_package).chomp
112
+ $CPPFLAGS += ' -x c++ -std=c++11 -Wno-register'
113
+ $LOCAL_LIBS += " #{ENV['LIBS']} " + PKGConfig.libs($magick_package).chomp
107
114
  $LDFLAGS += " #{ldflags} #{rpath}"
108
115
 
109
116
  unless try_link("int main() { }")
@@ -117,6 +124,7 @@ module RMagick
117
124
 
118
125
  dir_paths = search_paths_for_library_for_windows
119
126
  $CPPFLAGS += %( -I"#{dir_paths[:include]}")
127
+ $CPPFLAGS += ' -x c++ -std=c++11 -Wno-register'
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,13 +139,11 @@ module RMagick
131
139
 
132
140
  $LOCAL_LIBS += ' ' + (im_version_at_least?('7.0.0') ? 'CORE_RL_MagickCore_.lib' : 'CORE_RL_magick_.lib')
133
141
 
142
+ $CPPFLAGS += ' /std:c++11'
134
143
  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
144
+ ruby_version = RUBY_VERSION.split('.')
145
+ $CPPFLAGS += " -DRUBY_VERSION_MAJOR=#{ruby_version[0]} -DRUBY_VERSION_MINOR=#{ruby_version[1]}"
146
+ $CPPFLAGS += ' $(optflags) $(debugflags)'
141
147
  end
142
148
 
143
149
  def exit_failure(msg)
@@ -305,10 +311,8 @@ module RMagick
305
311
  exit_failure <<~END_MINGW
306
312
  Can't install RMagick #{RMAGICK_VERS}.
307
313
  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\"'
314
+
315
+ Please check PATH environment variable for ImageMagick installation path.
312
316
  END_MINGW
313
317
  end
314
318
 
@@ -316,9 +320,9 @@ module RMagick
316
320
  assert_minimum_ruby_version!
317
321
  assert_has_dev_libs!
318
322
 
319
- # Check for compiler. Extract first word so ENV['CC'] can be a program name with arguments.
320
- cc = (ENV['CC'] || RbConfig::CONFIG['CC'] || 'gcc').split(' ').first
321
- exit_failure "No C compiler found in ${ENV['PATH']}. See mkmf.log for details." unless find_executable(cc)
323
+ # Check for compiler. Extract first word so ENV['CXX'] can be a program name with arguments.
324
+ cxx = (ENV['CXX'] || RbConfig::CONFIG['CXX'] || 'g++').split(' ').first
325
+ exit_failure "No C++ compiler found in ${ENV['PATH']}. See mkmf.log for details." unless find_executable(cxx)
322
326
  end
323
327
 
324
328
  def assert_minimum_ruby_version!
@@ -361,7 +365,8 @@ module RMagick
361
365
  def create_header_file
362
366
  ruby_api = [
363
367
  'rb_gc_adjust_memory_usage', # Ruby 2.4.0
364
- 'rb_gc_mark_movable' # Ruby 2.7.0
368
+ 'rb_gc_mark_movable', # Ruby 2.7.0
369
+ 'rb_io_path' # Ruby 3.2.0
365
370
  ]
366
371
  memory_api = %w[
367
372
  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
-