rmagick 6.3.0 → 7.0.1

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 +21 -0
  3. data/Gemfile +3 -6
  4. data/README.md +49 -70
  5. data/Rakefile +1 -8
  6. data/ext/RMagick/extconf.rb +11 -41
  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 +77 -119
  14. data/ext/RMagick/rminfo.cpp +6 -8
  15. data/ext/RMagick/rmkinfo.cpp +14 -8
  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,14 +1,13 @@
1
- /**************************************************************************//**
2
- * Image class method definitions for RMagick.
3
- *
4
- * Copyright © 2002 - 2009 by Timothy P. Hunter
1
+ /**
2
+ * Image class methods.
5
3
  *
6
- * Changes since Nov. 2009 copyright © by Benjamin Thomas and Omer Bar-or
4
+ * Copyright (c) 2002 - 2009 Timothy P. Hunter
5
+ * Copyright (c) 2009 - Benjamin Thomas and Omer Bar-or
6
+ * Copyright (c) 2009 - RMagick contributors
7
7
  *
8
8
  * @file rmimage.cpp
9
- * @version $Id: rmimage.cpp,v 1.361 2010/05/03 03:34:48 baror Exp $
10
9
  * @author Tim Hunter
11
- ******************************************************************************/
10
+ */
12
11
 
13
12
  #include "rmagick.h"
14
13
  #include <signal.h>
@@ -224,6 +223,7 @@ DEFINE_GVL_STUB3(GammaImageChannel, Image *, const ChannelType, const double);
224
223
  DEFINE_GVL_STUB5(GaussianBlurImageChannel, const Image *, const ChannelType, const double, const double, ExceptionInfo *);
225
224
  DEFINE_GVL_STUB3(GetImageChannelDepth, const Image *, const ChannelType, ExceptionInfo *);
226
225
  DEFINE_GVL_STUB6(GetImageChannelDistortion, Image *, const Image *, const ChannelType, const MetricType, double *, ExceptionInfo *);
226
+ DEFINE_GVL_STUB4(GetImageChannelEntropy, const Image *, const ChannelType, double *, ExceptionInfo *);
227
227
  DEFINE_GVL_STUB5(GetImageChannelExtrema, const Image *, const ChannelType, size_t *, size_t *, ExceptionInfo *);
228
228
  DEFINE_GVL_STUB5(GetImageChannelMean, const Image *, const ChannelType, double *, double *, ExceptionInfo *);
229
229
  DEFINE_GVL_STUB2(GetImageClipMask, const Image *, ExceptionInfo *);
@@ -284,10 +284,6 @@ DEFINE_GVL_STUB2(WhiteThresholdImage, Image *, const char *);
284
284
  DEFINE_GVL_STUB2(WriteImage, const ImageInfo *, Image *);
285
285
  #endif
286
286
 
287
- #if defined(HAVE_GETIMAGECHANNELENTROPY)
288
- DEFINE_GVL_STUB4(GetImageChannelEntropy, const Image *, const ChannelType, double *, ExceptionInfo *);
289
- #endif
290
-
291
287
  DEFINE_GVL_STUB3(RotationalBlurImage, const Image *, const double, ExceptionInfo *);
292
288
 
293
289
  #if defined(IMAGEMAGICK_7)
@@ -300,22 +296,15 @@ DEFINE_GVL_STUB4(RotationalBlurImageChannel, const Image *, const ChannelType, c
300
296
  *
301
297
  * No Ruby usage (internal function)
302
298
  *
303
- * @hash the hash
299
+ * @kwargs the keyword arguments
304
300
  */
305
301
  static Quantum
306
- get_named_alpha_value(VALUE hash)
302
+ get_named_alpha_value(VALUE kwargs)
307
303
  {
308
- if (TYPE(hash) != T_HASH)
309
- {
310
- rb_raise(rb_eArgError, "missing keyword: alpha");
311
- }
304
+ ID keyword_ids[] = { rb_intern("alpha") };
305
+ VALUE alpha;
312
306
 
313
- if (FIX2ULONG(rb_hash_size(hash)) != 1)
314
- {
315
- rb_raise(rb_eArgError, "wrong number of arguments");
316
- }
317
-
318
- VALUE alpha = rb_hash_aref(hash, ID2SYM(rb_intern("alpha")));
307
+ rb_get_kwargs(kwargs, keyword_ids, 1, 0, &alpha);
319
308
  if (NIL_P(alpha))
320
309
  {
321
310
  rb_raise(rb_eArgError, "missing keyword: alpha");
@@ -2600,7 +2589,6 @@ Image_channel_mean(int argc, VALUE *argv, VALUE self)
2600
2589
  *
2601
2590
  * @return [Array<Float>] The first element in the array is the average entropy of the selected channels.
2602
2591
  */
2603
- #if defined(HAVE_GETIMAGECHANNELENTROPY) || defined(IMAGEMAGICK_7)
2604
2592
  VALUE
2605
2593
  Image_channel_entropy(int argc, VALUE *argv, VALUE self)
2606
2594
  {
@@ -2641,13 +2629,7 @@ Image_channel_entropy(int argc, VALUE *argv, VALUE self)
2641
2629
 
2642
2630
  return ary;
2643
2631
  }
2644
- #else
2645
- VALUE
2646
- Image_channel_entropy(int argc ATTRIBUTE_UNUSED, VALUE *argv ATTRIBUTE_UNUSED, VALUE self ATTRIBUTE_UNUSED)
2647
- {
2648
- rm_not_implemented();
2649
- }
2650
- #endif
2632
+
2651
2633
 
2652
2634
  /**
2653
2635
  * Return a new image that is a copy of the input image with the edges highlighted.
@@ -7947,6 +7929,13 @@ has_image_attribute(VALUE self, MagickBooleanType (attr_test)(const Image *))
7947
7929
  }
7948
7930
  #endif
7949
7931
 
7932
+ static MagickBooleanType
7933
+ Image_is_gray_colorspace_type(const Image *image, ExceptionInfo *exception)
7934
+ {
7935
+ ColorspaceType colorspace = GetImageColorspaceType(image, exception);
7936
+ return (colorspace == GRAYColorspace || colorspace == LinearGRAYColorspace) ? MagickTrue : MagickFalse;
7937
+ }
7938
+
7950
7939
 
7951
7940
  /**
7952
7941
  * Return true if all the pixels in the image have the same red, green, and blue intensities.
@@ -7956,11 +7945,7 @@ has_image_attribute(VALUE self, MagickBooleanType (attr_test)(const Image *))
7956
7945
  VALUE
7957
7946
  Image_gray_q(VALUE self)
7958
7947
  {
7959
- #if defined(HAVE_SETIMAGEGRAY)
7960
- return has_attribute(self, (MagickBooleanType (*)(const Image *, ExceptionInfo *))SetImageGray);
7961
- #else
7962
- return has_attribute(self, IsGrayImage);
7963
- #endif
7948
+ return has_attribute(self, Image_is_gray_colorspace_type);
7964
7949
  }
7965
7950
 
7966
7951
 
@@ -9366,25 +9351,23 @@ Image_matte_flood_fill(int argc, VALUE *argv, VALUE self)
9366
9351
  #if defined(IMAGEMAGICK_7)
9367
9352
  ExceptionInfo *exception;
9368
9353
  #endif
9354
+ VALUE color_obj, x_obj, y_obj, method_obj, kwargs;
9369
9355
 
9370
9356
  image = rm_check_destroyed(self);
9371
9357
 
9372
- if (argc != 5)
9373
- {
9374
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 5)", argc);
9375
- }
9358
+ rb_scan_args(argc, argv, "4:", &color_obj, &x_obj, &y_obj, &method_obj, &kwargs);
9376
9359
 
9377
- alpha = get_named_alpha_value(argv[4]);
9360
+ alpha = get_named_alpha_value(kwargs);
9378
9361
 
9379
- Color_to_PixelColor(&target, argv[0]);
9380
- VALUE_TO_ENUM(argv[3], method, PaintMethod);
9362
+ Color_to_PixelColor(&target, color_obj);
9363
+ VALUE_TO_ENUM(method_obj, method, PaintMethod);
9381
9364
  if (!(method == FloodfillMethod || method == FillToBorderMethod))
9382
9365
  {
9383
9366
  rb_raise(rb_eArgError, "paint method_obj must be FloodfillMethod or "
9384
9367
  "FillToBorderMethod (%d given)", method);
9385
9368
  }
9386
- x = NUM2LONG(argv[1]);
9387
- y = NUM2LONG(argv[2]);
9369
+ x = NUM2LONG(x_obj);
9370
+ y = NUM2LONG(y_obj);
9388
9371
  if ((unsigned long)x > image->columns || (unsigned long)y > image->rows)
9389
9372
  {
9390
9373
  rb_raise(rb_eArgError, "target out of range. %ldx%ld given, image is %" RMIuSIZE "x%" RMIuSIZE "",
@@ -10479,41 +10462,18 @@ Image_paint_transparent(int argc, VALUE *argv, VALUE self)
10479
10462
  #if defined(IMAGEMAGICK_7)
10480
10463
  ExceptionInfo *exception;
10481
10464
  #endif
10465
+ VALUE color_obj, invert_obj, fuzz_obj, kwargs;
10482
10466
 
10483
10467
  image = rm_check_destroyed(self);
10484
10468
 
10485
- // Default fuzz value is image's fuzz attribute.
10486
- fuzz = image->fuzz;
10487
- invert = MagickFalse;
10469
+ rb_scan_args(argc, argv, "12:", &color_obj, &invert_obj, &fuzz_obj, &kwargs);
10488
10470
 
10489
- switch (argc)
10471
+ Color_to_MagickPixel(image, &color, color_obj);
10472
+ invert = (invert_obj != Qnil) ? (MagickBooleanType)RTEST(invert_obj) : MagickFalse;
10473
+ fuzz = (fuzz_obj != Qnil) ? NUM2DBL(fuzz_obj) : image->fuzz;
10474
+ if (RTEST(kwargs))
10490
10475
  {
10491
- case 4:
10492
- if (TYPE(argv[argc - 1]) == T_HASH)
10493
- {
10494
- fuzz = NUM2DBL(argv[2]);
10495
- }
10496
- else
10497
- {
10498
- fuzz = NUM2DBL(argv[3]);
10499
- }
10500
- case 3:
10501
- if (TYPE(argv[argc - 1]) == T_HASH)
10502
- {
10503
- invert = (MagickBooleanType)RTEST(argv[1]);
10504
- }
10505
- else
10506
- {
10507
- invert = (MagickBooleanType)RTEST(argv[2]);
10508
- }
10509
- case 2:
10510
- alpha = get_named_alpha_value(argv[argc - 1]);
10511
- case 1:
10512
- Color_to_MagickPixel(image, &color, argv[0]);
10513
- break;
10514
- default:
10515
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 1 to 4)", argc);
10516
- break;
10476
+ alpha = get_named_alpha_value(kwargs);
10517
10477
  }
10518
10478
 
10519
10479
  new_image = rm_clone_image(image);
@@ -11398,15 +11358,24 @@ Image_random_threshold_channel(int argc, VALUE *argv, VALUE self)
11398
11358
  exception = AcquireExceptionInfo();
11399
11359
 
11400
11360
  #if defined(IMAGEMAGICK_7)
11401
- BEGIN_CHANNEL_MASK(new_image, channels);
11402
11361
  {
11403
11362
  GeometryInfo geometry_info;
11404
11363
 
11405
- ParseGeometry(thresholds, &geometry_info);
11406
- GVL_STRUCT_TYPE(RandomThresholdImage) args = { new_image, geometry_info.rho, geometry_info.sigma, exception };
11407
- CALL_FUNC_WITHOUT_GVL(GVL_FUNC(RandomThresholdImage), &args);
11364
+ if (ParseGeometry(thresholds, &geometry_info) == NoValue && *thresholds)
11365
+ {
11366
+ (void) ThrowMagickException(exception, GetMagickModule(), OptionError,
11367
+ "InvalidArgument", "'%s'", thresholds);
11368
+ }
11369
+ else
11370
+ {
11371
+ BEGIN_CHANNEL_MASK(new_image, channels);
11372
+ {
11373
+ GVL_STRUCT_TYPE(RandomThresholdImage) args = { new_image, geometry_info.rho, geometry_info.sigma, exception };
11374
+ CALL_FUNC_WITHOUT_GVL(GVL_FUNC(RandomThresholdImage), &args);
11375
+ }
11376
+ END_CHANNEL_MASK(new_image);
11377
+ }
11408
11378
  }
11409
- END_CHANNEL_MASK(new_image);
11410
11379
  #else
11411
11380
  GVL_STRUCT_TYPE(RandomThresholdImageChannel) args = { new_image, channels, thresholds, exception };
11412
11381
  CALL_FUNC_WITHOUT_GVL(GVL_FUNC(RandomThresholdImageChannel), &args);
@@ -14215,31 +14184,33 @@ threshold_image(int argc, VALUE *argv, VALUE self, gvl_function_t fp)
14215
14184
  #if defined(IMAGEMAGICK_7)
14216
14185
  ExceptionInfo *exception;
14217
14186
  #endif
14187
+ VALUE red_obj, green_obj, blue_obj, kwargs;
14218
14188
 
14219
14189
  image = rm_check_destroyed(self);
14220
14190
 
14191
+ rb_scan_args(argc, argv, "12:", &red_obj, &green_obj, &blue_obj, &kwargs);
14221
14192
  switch (argc)
14222
14193
  {
14223
14194
  case 4:
14224
- red = NUM2DBL(argv[0]);
14225
- green = NUM2DBL(argv[1]);
14226
- blue = NUM2DBL(argv[2]);
14227
- alpha = get_named_alpha_value(argv[3]);
14195
+ red = NUM2DBL(red_obj);
14196
+ green = NUM2DBL(green_obj);
14197
+ blue = NUM2DBL(blue_obj);
14198
+ alpha = get_named_alpha_value(kwargs);
14228
14199
  snprintf(ctarg, sizeof(ctarg), "%f,%f,%f,%f", red, green, blue, QuantumRange - alpha);
14229
14200
  break;
14230
14201
  case 3:
14231
- red = NUM2DBL(argv[0]);
14232
- green = NUM2DBL(argv[1]);
14233
- blue = NUM2DBL(argv[2]);
14202
+ red = NUM2DBL(red_obj);
14203
+ green = NUM2DBL(green_obj);
14204
+ blue = NUM2DBL(blue_obj);
14234
14205
  snprintf(ctarg, sizeof(ctarg), "%f,%f,%f", red, green, blue);
14235
14206
  break;
14236
14207
  case 2:
14237
- red = NUM2DBL(argv[0]);
14238
- green = NUM2DBL(argv[1]);
14208
+ red = NUM2DBL(red_obj);
14209
+ green = NUM2DBL(green_obj);
14239
14210
  snprintf(ctarg, sizeof(ctarg), "%f,%f", red, green);
14240
14211
  break;
14241
14212
  case 1:
14242
- red = NUM2DBL(argv[0]);
14213
+ red = NUM2DBL(red_obj);
14243
14214
  snprintf(ctarg, sizeof(ctarg), "%f", red);
14244
14215
  break;
14245
14216
  default:
@@ -14704,20 +14675,15 @@ Image_transparent(int argc, VALUE *argv, VALUE self)
14704
14675
  #if defined(IMAGEMAGICK_7)
14705
14676
  ExceptionInfo *exception;
14706
14677
  #endif
14707
-
14678
+ VALUE color_obj, kwargs;
14708
14679
 
14709
14680
  image = rm_check_destroyed(self);
14710
14681
 
14711
- switch (argc)
14682
+ rb_scan_args(argc, argv, "1:", &color_obj, &kwargs);
14683
+ Color_to_MagickPixel(image, &color, color_obj);
14684
+ if (RTEST(kwargs))
14712
14685
  {
14713
- case 2:
14714
- alpha = get_named_alpha_value(argv[1]);
14715
- case 1:
14716
- Color_to_MagickPixel(image, &color, argv[0]);
14717
- break;
14718
- default:
14719
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 1 or 2)", argc);
14720
- break;
14686
+ alpha = get_named_alpha_value(kwargs);
14721
14687
  }
14722
14688
 
14723
14689
  new_image = rm_clone_image(image);
@@ -14773,29 +14739,21 @@ Image_transparent_chroma(int argc, VALUE *argv, VALUE self)
14773
14739
  #if defined(IMAGEMAGICK_7)
14774
14740
  ExceptionInfo *exception;
14775
14741
  #endif
14742
+ VALUE low_obj, high_obj, invert_obj, kwargs;
14776
14743
 
14777
14744
  image = rm_check_destroyed(self);
14778
14745
 
14779
- switch (argc)
14746
+ rb_scan_args(argc, argv, "21:", &low_obj, &high_obj, &invert_obj, &kwargs);
14747
+
14748
+ Color_to_MagickPixel(image, &low, low_obj);
14749
+ Color_to_MagickPixel(image, &high, high_obj);
14750
+ if (invert_obj != Qnil)
14780
14751
  {
14781
- case 4:
14782
- if (TYPE(argv[argc - 1]) == T_HASH)
14783
- {
14784
- invert = (MagickBooleanType)RTEST(argv[3]);
14785
- }
14786
- else
14787
- {
14788
- invert = (MagickBooleanType)RTEST(argv[2]);
14789
- }
14790
- case 3:
14791
- alpha = get_named_alpha_value(argv[argc - 1]);
14792
- case 2:
14793
- Color_to_MagickPixel(image, &high, argv[1]);
14794
- Color_to_MagickPixel(image, &low, argv[0]);
14795
- break;
14796
- default:
14797
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 2, 3 or 4)", argc);
14798
- break;
14752
+ invert = (MagickBooleanType)RTEST(invert_obj);
14753
+ }
14754
+ if (RTEST(kwargs))
14755
+ {
14756
+ alpha = get_named_alpha_value(kwargs);
14799
14757
  }
14800
14758
 
14801
14759
  new_image = rm_clone_image(image);
@@ -1,14 +1,13 @@
1
- /**************************************************************************//**
2
- * Info class method definitions for RMagick.
3
- *
4
- * Copyright &copy; 2002 - 2009 by Timothy P. Hunter
1
+ /**
2
+ * Info class methods.
5
3
  *
6
- * Changes since Nov. 2009 copyright &copy; by Benjamin Thomas and Omer Bar-or
4
+ * Copyright (c) 2002 - 2009 Timothy P. Hunter
5
+ * Copyright (c) 2009 - Benjamin Thomas and Omer Bar-or
6
+ * Copyright (c) 2009 - RMagick contributors
7
7
  *
8
8
  * @file rminfo.cpp
9
- * @version $Id: rminfo.cpp,v 1.79 2009/12/20 02:33:33 baror Exp $
10
9
  * @author Tim Hunter
11
- ******************************************************************************/
10
+ */
12
11
 
13
12
  #include "rmagick.h"
14
13
 
@@ -2417,4 +2416,3 @@ Info_initialize(VALUE self)
2417
2416
  }
2418
2417
  return self;
2419
2418
  }
2420
-
@@ -1,12 +1,13 @@
1
- /************************************************************************//**
2
- * KernelInfo class definitions for RMagick.
1
+ /**
2
+ * KernelInfo class methods.
3
3
  *
4
- * Copyright &copy; RMagick Project
4
+ * Copyright (c) 2002 - 2009 Timothy P. Hunter
5
+ * Copyright (c) 2009 - Benjamin Thomas and Omer Bar-or
6
+ * Copyright (c) 2009 - RMagick contributors
5
7
  *
6
- * @file rmkinfo.cpp
7
- * @version $Id: rmkinfo.cpp,v 1.0 2011/11/29 15:33:14 naquad Exp $
8
- * @author Naquad
9
- ****************************************************************************/
8
+ * @file rmkinfo.cpp
9
+ * @author Tim Hunter
10
+ */
10
11
 
11
12
  #include "rmagick.h"
12
13
 
@@ -179,12 +180,17 @@ KernelInfo_builtin(VALUE self, VALUE what, VALUE geometry)
179
180
  KernelInfo *kernel;
180
181
  KernelInfoType kernel_type;
181
182
  GeometryInfo info;
183
+ const char *geom_str;
182
184
  #if defined(IMAGEMAGICK_7)
183
185
  ExceptionInfo *exception;
184
186
  #endif
185
187
 
186
188
  VALUE_TO_ENUM(what, kernel_type, KernelInfoType);
187
- ParseGeometry(StringValueCStr(geometry), &info);
189
+ geom_str = StringValueCStr(geometry);
190
+ if (ParseGeometry(geom_str, &info) == NoValue && *geom_str)
191
+ {
192
+ rb_raise(rb_eArgError, "invalid geometry string");
193
+ }
188
194
 
189
195
  #if defined(IMAGEMAGICK_7)
190
196
  exception = AcquireExceptionInfo();
@@ -1,15 +1,14 @@
1
- /**************************************************************************//**
2
- * Contains all module, class, method declarations. Defines all constants.
3
- * Contains Magick module methods.
4
- *
5
- * Copyright &copy; 2002 - 2009 by Timothy P. Hunter
1
+ /**
2
+ * All module, class, method declarations. Defines all constants.
3
+ * Magick module methods.
6
4
  *
7
- * Changes since Nov. 2009 copyright &copy; by Benjamin Thomas and Omer Bar-or
5
+ * Copyright (c) 2002 - 2009 Timothy P. Hunter
6
+ * Copyright (c) 2009 - Benjamin Thomas and Omer Bar-or
7
+ * Copyright (c) 2009 - RMagick contributors
8
8
  *
9
9
  * @file rmmain.cpp
10
- * @version $Id: rmmain.cpp,v 1.303 2009/12/20 02:33:33 baror Exp $
11
10
  * @author Tim Hunter
12
- ******************************************************************************/
11
+ */
13
12
 
14
13
  #define MAIN // Define external variables
15
14
  #include "rmagick.h"
@@ -209,18 +208,7 @@ static void set_managed_memory(void)
209
208
  return;
210
209
  }
211
210
 
212
- #if defined(_WIN32)
213
- #if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_9_0)
214
- managed_memory_enable(Qtrue);
215
- #else
216
- // Disable managed memory feature with ImageMagick 6.8.x or below because causes crash.
217
- // Refer https://ci.appveyor.com/project/mockdeep/rmagick/builds/24706171
218
- managed_memory_enable(Qfalse);
219
- #endif
220
- #else
221
- // Not Windows
222
211
  managed_memory_enable(Qtrue);
223
- #endif
224
212
  }
225
213
 
226
214
 
@@ -1106,12 +1094,8 @@ Init_RMagick2(void)
1106
1094
  ENUMERATOR(YDbDrColorspace)
1107
1095
  ENUMERATORV(XyYColorspace, xyYColorspace)
1108
1096
  #if defined(IMAGEMAGICK_7)
1109
- #if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_7_0_8)
1110
1097
  ENUMERATOR(LinearGRAYColorspace)
1111
- #endif
1112
- #if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_7_0_10)
1113
1098
  ENUMERATOR(JzazbzColorspace)
1114
- #endif
1115
1099
  #elif defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_9_10)
1116
1100
  ENUMERATOR(LinearGRAYColorspace)
1117
1101
  #endif
@@ -1,14 +1,13 @@
1
- /**************************************************************************//**
2
- * Contains Montage class methods.
3
- *
4
- * Copyright &copy; 2002 - 2009 by Timothy P. Hunter
1
+ /**
2
+ * Montage class methods.
5
3
  *
6
- * Changes since Nov. 2009 copyright &copy; by Benjamin Thomas and Omer Bar-or
4
+ * Copyright (c) 2002 - 2009 Timothy P. Hunter
5
+ * Copyright (c) 2009 - Benjamin Thomas and Omer Bar-or
6
+ * Copyright (c) 2009 - RMagick contributors
7
7
  *
8
8
  * @file rmmontage.cpp
9
- * @version $Id: rmmontage.cpp,v 1.5 2009/12/20 02:33:33 baror Exp $
10
9
  * @author Tim Hunter
11
- ******************************************************************************/
10
+ */
12
11
 
13
12
  #include "rmagick.h"
14
13
 
@@ -471,4 +470,3 @@ rm_montage_new(void)
471
470
  {
472
471
  return Montage_initialize(Montage_alloc(Class_Montage));
473
472
  }
474
-
@@ -1,14 +1,13 @@
1
- /**************************************************************************//**
2
- * Contains Pixel class methods.
3
- *
4
- * Copyright &copy; 2002 - 2009 by Timothy P. Hunter
1
+ /**
2
+ * Pixel class methods.
5
3
  *
6
- * Changes since Nov. 2009 copyright &copy; by Benjamin Thomas and Omer Bar-or
4
+ * Copyright (c) 2002 - 2009 Timothy P. Hunter
5
+ * Copyright (c) 2009 - Benjamin Thomas and Omer Bar-or
6
+ * Copyright (c) 2009 - RMagick contributors
7
7
  *
8
8
  * @file rmpixel.cpp
9
- * @version $Id: rmpixel.cpp,v 1.7 2009/12/21 10:34:58 baror Exp $
10
9
  * @author Tim Hunter
11
- ******************************************************************************/
10
+ */
12
11
 
13
12
  #include "rmagick.h"
14
13
 
@@ -1,20 +1,17 @@
1
- /**************************************************************************//**
2
- * Contains various Struct class methods.
3
- *
4
- * Copyright &copy; 2002 - 2009 by Timothy P. Hunter
1
+ /**
2
+ * Various Struct class methods.
5
3
  *
6
- * Changes since Nov. 2009 copyright &copy; by Benjamin Thomas and Omer Bar-or
4
+ * Copyright (c) 2002 - 2009 Timothy P. Hunter
5
+ * Copyright (c) 2009 - Benjamin Thomas and Omer Bar-or
6
+ * Copyright (c) 2009 - RMagick contributors
7
7
  *
8
8
  * @file rmstruct.cpp
9
- * @version $Id: rmstruct.cpp,v 1.5 2009/12/20 02:33:34 baror Exp $
10
9
  * @author Tim Hunter
11
- ******************************************************************************/
10
+ */
12
11
 
13
12
  #include "rmagick.h"
14
13
 
15
14
 
16
-
17
-
18
15
  /**
19
16
  * Given a C AffineMatrix, create the equivalent AffineMatrix object.
20
17
  *
@@ -560,7 +557,7 @@ VALUE
560
557
  Import_PointInfo(PointInfo *p)
561
558
  {
562
559
  return rb_funcall(Class_Point, rm_ID_new, 2,
563
- INT2FIX(p->x), INT2FIX(p->y));
560
+ rb_float_new(p->x), rb_float_new(p->y));
564
561
  }
565
562
 
566
563
 
@@ -605,7 +602,7 @@ VALUE
605
602
  Import_PrimaryInfo(PrimaryInfo *p)
606
603
  {
607
604
  return rb_funcall(Class_Primary, rm_ID_new, 3,
608
- INT2FIX(p->x), INT2FIX(p->y), INT2FIX(p->z));
605
+ rb_float_new(p->x), rb_float_new(p->y), rb_float_new(p->z));
609
606
  }
610
607
 
611
608
 
@@ -941,4 +938,3 @@ TypeMetric_to_s(VALUE self)
941
938
 
942
939
  return str;
943
940
  }
944
-
@@ -1,14 +1,13 @@
1
- /**************************************************************************//**
2
- * Utility functions for RMagick.
3
- *
4
- * Copyright &copy; 2002 - 2009 by Timothy P. Hunter
1
+ /**
2
+ * Utility functions.
5
3
  *
6
- * Changes since Nov. 2009 copyright &copy; by Benjamin Thomas and Omer Bar-or
4
+ * Copyright (c) 2002 - 2009 Timothy P. Hunter
5
+ * Copyright (c) 2009 - Benjamin Thomas and Omer Bar-or
6
+ * Copyright (c) 2009 - RMagick contributors
7
7
  *
8
8
  * @file rmutil.cpp
9
- * @version $Id: rmutil.cpp,v 1.182 2009/12/21 10:34:58 baror Exp $
10
9
  * @author Tim Hunter
11
- ******************************************************************************/
10
+ */
12
11
 
13
12
  #include "rmagick.h"
14
13
  #include <errno.h>
@@ -777,26 +776,6 @@ rm_delete_temp_image(char *temp_name)
777
776
  }
778
777
 
779
778
 
780
- /**
781
- * Raise NotImplementedError.
782
- *
783
- * No Ruby usage (internal function)
784
- *
785
- * Notes:
786
- * - Called when a xMagick API is not available.
787
- * - Replaces Ruby's rb_notimplement function.
788
- *
789
- * @throw NotImpError
790
- */
791
- void
792
- rm_not_implemented(void)
793
- {
794
-
795
- rb_raise(rb_eNotImpError, "the `%s' method is not supported by ImageMagick "
796
- MagickLibVersionText, rb_id2name(rb_frame_this_func()));
797
- }
798
-
799
-
800
779
  /**
801
780
  * Create a new ImageMagickError object and raise an exception.
802
781
  *
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Magick
4
- VERSION = '6.3.0'
5
- MIN_RUBY_VERSION = '3.0.0'
6
- MIN_IM_VERSION = '6.8.9'
4
+ VERSION = '7.0.1'
5
+ MIN_RUBY_VERSION = '3.2.0'
6
+ MIN_IM6_VERSION = '6.9.0'
7
+ MIN_IM7_VERSION = '7.1.0'
7
8
  end