rmagick 2.13.1 → 2.13.4

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 (218) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.travis.yml +57 -0
  4. data/CONTRIBUTING.md +22 -0
  5. data/ChangeLog +49 -2
  6. data/Gemfile +7 -0
  7. data/LICENSE +20 -0
  8. data/README.textile +161 -0
  9. data/Rakefile +176 -0
  10. data/before_install_linux.sh +12 -0
  11. data/before_install_osx.sh +2 -0
  12. data/doc/.cvsignore +1 -0
  13. data/doc/comtasks.html +2 -2
  14. data/doc/constants.html +2 -2
  15. data/doc/draw.html +2 -2
  16. data/doc/ex/PreserveAspectRatio.rb +0 -0
  17. data/doc/ex/ViewBox.rb +0 -0
  18. data/doc/ex/adaptive_threshold.rb +0 -0
  19. data/doc/ex/add_noise.rb +0 -0
  20. data/doc/ex/affine.rb +0 -0
  21. data/doc/ex/affine_transform.rb +0 -0
  22. data/doc/ex/arc.rb +0 -0
  23. data/doc/ex/arcpath.rb +0 -0
  24. data/doc/ex/average.rb +0 -0
  25. data/doc/ex/axes.rb +0 -0
  26. data/doc/ex/bilevel_channel.rb +0 -0
  27. data/doc/ex/blur_image.rb +0 -0
  28. data/doc/ex/border.rb +0 -0
  29. data/doc/ex/bounding_box.rb +0 -0
  30. data/doc/ex/cbezier1.rb +0 -0
  31. data/doc/ex/cbezier2.rb +0 -0
  32. data/doc/ex/cbezier3.rb +0 -0
  33. data/doc/ex/cbezier4.rb +0 -0
  34. data/doc/ex/cbezier5.rb +0 -0
  35. data/doc/ex/cbezier6.rb +0 -0
  36. data/doc/ex/channel.rb +0 -0
  37. data/doc/ex/charcoal.rb +0 -0
  38. data/doc/ex/chop.rb +0 -0
  39. data/doc/ex/circle.rb +0 -0
  40. data/doc/ex/clip_path.rb +0 -0
  41. data/doc/ex/coalesce.rb +0 -0
  42. data/doc/ex/color_fill_to_border.rb +0 -0
  43. data/doc/ex/color_floodfill.rb +0 -0
  44. data/doc/ex/color_histogram.rb +0 -0
  45. data/doc/ex/color_reset.rb +0 -0
  46. data/doc/ex/colorize.rb +0 -0
  47. data/doc/ex/colors.rb +0 -0
  48. data/doc/ex/composite.rb +0 -0
  49. data/doc/ex/composite_layers.rb +0 -0
  50. data/doc/ex/contrast.rb +0 -0
  51. data/doc/ex/crop.rb +0 -0
  52. data/doc/ex/cycle_colormap.rb +0 -0
  53. data/doc/ex/drawcomp.rb +0 -0
  54. data/doc/ex/drop_shadow.rb +0 -0
  55. data/doc/ex/edge.rb +0 -0
  56. data/doc/ex/ellipse.rb +0 -0
  57. data/doc/ex/emboss.rb +0 -0
  58. data/doc/ex/enhance.rb +0 -0
  59. data/doc/ex/equalize.rb +0 -0
  60. data/doc/ex/evenodd.rb +0 -0
  61. data/doc/ex/flatten_images.rb +0 -0
  62. data/doc/ex/flip.rb +0 -0
  63. data/doc/ex/flop.rb +0 -0
  64. data/doc/ex/fonts.rb +0 -0
  65. data/doc/ex/frame.rb +0 -0
  66. data/doc/ex/gaussian_blur.rb +0 -0
  67. data/doc/ex/get_pixels.rb +0 -0
  68. data/doc/ex/gradientfill.rb +0 -0
  69. data/doc/ex/grav.rb +0 -0
  70. data/doc/ex/gravity.rb +0 -0
  71. data/doc/ex/hatchfill.rb +0 -0
  72. data/doc/ex/images/image_with_profile.jpg +0 -0
  73. data/doc/ex/images/logo400x83.gif +0 -0
  74. data/doc/ex/implode.rb +0 -0
  75. data/doc/ex/level.rb +0 -0
  76. data/doc/ex/line.rb +0 -0
  77. data/doc/ex/mask.rb +1 -1
  78. data/doc/ex/matte_fill_to_border.rb +0 -0
  79. data/doc/ex/matte_floodfill.rb +0 -0
  80. data/doc/ex/matte_replace.rb +0 -0
  81. data/doc/ex/median_filter.rb +0 -0
  82. data/doc/ex/modulate.rb +0 -0
  83. data/doc/ex/mono.rb +0 -0
  84. data/doc/ex/morph.rb +0 -0
  85. data/doc/ex/mosaic.rb +0 -0
  86. data/doc/ex/motion_blur.rb +0 -0
  87. data/doc/ex/negate.rb +0 -0
  88. data/doc/ex/nested_rvg.rb +0 -0
  89. data/doc/ex/nonzero.rb +0 -0
  90. data/doc/ex/normalize.rb +0 -0
  91. data/doc/ex/oil_paint.rb +0 -0
  92. data/doc/ex/opacity.rb +0 -0
  93. data/doc/ex/ordered_dither.rb +0 -0
  94. data/doc/ex/path.rb +0 -0
  95. data/doc/ex/pattern1.rb +0 -0
  96. data/doc/ex/pattern2.rb +0 -0
  97. data/doc/ex/polygon.rb +0 -0
  98. data/doc/ex/polyline.rb +0 -0
  99. data/doc/ex/preview.rb +0 -0
  100. data/doc/ex/qbezierpath.rb +0 -0
  101. data/doc/ex/quantize-m.rb +0 -0
  102. data/doc/ex/radial_blur.rb +0 -0
  103. data/doc/ex/raise.rb +0 -0
  104. data/doc/ex/rectangle.rb +0 -0
  105. data/doc/ex/reduce_noise.rb +0 -0
  106. data/doc/ex/roll.rb +0 -0
  107. data/doc/ex/rotate.rb +0 -0
  108. data/doc/ex/rotate_f.rb +0 -0
  109. data/doc/ex/roundrect.rb +0 -0
  110. data/doc/ex/rubyname.rb +0 -0
  111. data/doc/ex/rvg_linecap.rb +0 -0
  112. data/doc/ex/rvg_linejoin.rb +0 -0
  113. data/doc/ex/rvg_opacity.rb +0 -0
  114. data/doc/ex/rvg_stroke_dasharray.rb +0 -0
  115. data/doc/ex/segment.rb +0 -0
  116. data/doc/ex/shade.rb +0 -0
  117. data/doc/ex/shave.rb +0 -0
  118. data/doc/ex/shear.rb +0 -0
  119. data/doc/ex/sketch.rb +0 -0
  120. data/doc/ex/skewx.rb +0 -0
  121. data/doc/ex/skewy.rb +0 -0
  122. data/doc/ex/smile.rb +0 -0
  123. data/doc/ex/solarize.rb +0 -0
  124. data/doc/ex/spread.rb +0 -0
  125. data/doc/ex/stegano.rb +0 -0
  126. data/doc/ex/stroke_dasharray.rb +0 -0
  127. data/doc/ex/stroke_fill.rb +0 -0
  128. data/doc/ex/stroke_linecap.rb +0 -0
  129. data/doc/ex/stroke_linejoin.rb +0 -0
  130. data/doc/ex/stroke_width.rb +0 -0
  131. data/doc/ex/swirl.rb +0 -0
  132. data/doc/ex/text.rb +0 -0
  133. data/doc/ex/text_align.rb +0 -0
  134. data/doc/ex/text_antialias.rb +0 -0
  135. data/doc/ex/text_undercolor.rb +0 -0
  136. data/doc/ex/texture_fill_to_border.rb +0 -0
  137. data/doc/ex/texture_floodfill.rb +0 -0
  138. data/doc/ex/texturefill.rb +0 -0
  139. data/doc/ex/threshold.rb +0 -0
  140. data/doc/ex/to_blob.rb +0 -0
  141. data/doc/ex/translate.rb +0 -0
  142. data/doc/ex/transparent.rb +0 -0
  143. data/doc/ex/unsharp_mask.rb +0 -0
  144. data/doc/ex/wave.rb +0 -0
  145. data/doc/ilist.html +2 -2
  146. data/doc/image1.html +2 -2
  147. data/doc/image2.html +2 -2
  148. data/doc/image3.html +2 -2
  149. data/doc/imageattrs.html +2 -2
  150. data/doc/imusage.html +2 -2
  151. data/doc/index.html +3 -3
  152. data/doc/info.html +2 -2
  153. data/doc/magick.html +2 -2
  154. data/doc/optequiv.html +2 -2
  155. data/doc/rvg.html +2 -2
  156. data/doc/rvgclip.html +2 -2
  157. data/doc/rvggroup.html +2 -2
  158. data/doc/rvgimage.html +2 -2
  159. data/doc/rvgpattern.html +2 -2
  160. data/doc/rvgshape.html +2 -2
  161. data/doc/rvgstyle.html +2 -2
  162. data/doc/rvgtext.html +2 -2
  163. data/doc/rvgtspan.html +2 -2
  164. data/doc/rvgtut.html +2 -2
  165. data/doc/rvguse.html +2 -2
  166. data/doc/rvgxform.html +2 -2
  167. data/doc/struct.html +2 -2
  168. data/doc/usage.html +2 -2
  169. data/examples/crop_with_gravity.rb +0 -0
  170. data/examples/demo.rb +0 -0
  171. data/examples/describe.rb +0 -0
  172. data/examples/identify.rb +1 -1
  173. data/examples/rotating_text.rb +0 -0
  174. data/ext/RMagick/extconf.rb +62 -31
  175. data/ext/RMagick/rmagick.c +15 -15
  176. data/ext/RMagick/rmagick.h +9 -7
  177. data/ext/RMagick/rmdraw.c +12 -12
  178. data/ext/RMagick/rmenum.c +2 -2
  179. data/ext/RMagick/rmfill.c +25 -25
  180. data/ext/RMagick/rmilist.c +121 -104
  181. data/ext/RMagick/rmimage.c +743 -548
  182. data/ext/RMagick/rminfo.c +15 -15
  183. data/ext/RMagick/rmmain.c +27 -3
  184. data/ext/RMagick/rmpixel.c +25 -27
  185. data/ext/RMagick/rmstruct.c +1 -1
  186. data/ext/RMagick/rmutil.c +18 -18
  187. data/lib/RMagick.rb +1 -1962
  188. data/lib/rmagick/version.rb +5 -0
  189. data/lib/rmagick.rb +1 -0
  190. data/lib/rmagick_internal.rb +1964 -0
  191. data/rmagick.gemspec +21 -9
  192. data/test/Draw.rb +121 -0
  193. data/test/Image1.rb +763 -0
  194. data/test/Image2.rb +1312 -0
  195. data/test/Image3.rb +1033 -0
  196. data/test/ImageList1.rb +808 -0
  197. data/test/ImageList2.rb +389 -0
  198. data/test/Image_attributes.rb +700 -0
  199. data/test/Import_Export.rb +126 -0
  200. data/test/Info.rb +349 -0
  201. data/test/Magick.rb +324 -0
  202. data/test/Pixel.rb +119 -0
  203. data/test/Preview.rb +62 -0
  204. data/test/cmyk.icm +0 -0
  205. data/test/srgb.icm +0 -0
  206. data/test/test_all_basic.rb +34 -0
  207. data/test/tmpnam_test.rb +50 -0
  208. metadata +395 -352
  209. data/README-Mac-OSX.txt +0 -1
  210. data/README.html +0 -10
  211. data/build_tarball.rake +0 -215
  212. data/ext/RMagick/MANIFEST +0 -358
  213. data/metaconfig +0 -7
  214. data/post-clean.rb +0 -12
  215. data/post-install.rb +0 -50
  216. data/post-setup.rb +0 -254
  217. data/setup.rb +0 -1585
  218. data/uninstall.rb +0 -74
data/ext/RMagick/rminfo.c CHANGED
@@ -93,7 +93,7 @@ static VALUE set_color_option(VALUE self, const char *option, VALUE color)
93
93
  Info *info;
94
94
  char *name;
95
95
  PixelPacket pp;
96
- ExceptionInfo exception;
96
+ ExceptionInfo *exception;
97
97
  MagickBooleanType okay;
98
98
 
99
99
  Data_Get_Struct(self, Info, info);
@@ -104,10 +104,10 @@ static VALUE set_color_option(VALUE self, const char *option, VALUE color)
104
104
  }
105
105
  else
106
106
  {
107
- GetExceptionInfo(&exception);
107
+ exception = AcquireExceptionInfo();
108
108
  name = StringValuePtr(color);
109
- okay = QueryColorDatabase(name, &pp, &exception);
110
- (void) DestroyExceptionInfo(&exception);
109
+ okay = QueryColorDatabase(name, &pp, exception);
110
+ (void) DestroyExceptionInfo(exception);
111
111
  if (!okay)
112
112
  {
113
113
  rb_raise(rb_eArgError, "invalid color name `%s'", name);
@@ -960,11 +960,11 @@ Info_depth_eq(VALUE self, VALUE depth)
960
960
  switch (d)
961
961
  {
962
962
  case 8: // always okay
963
- #if QuantumDepth == 16 || QuantumDepth == 32 || QuantumDepth == 64
963
+ #if MAGICKCORE_QUANTUM_DEPTH == 16 || MAGICKCORE_QUANTUM_DEPTH == 32 || MAGICKCORE_QUANTUM_DEPTH == 64
964
964
  case 16:
965
- #if QuantumDepth == 32 || QuantumDepth == 64
965
+ #if MAGICKCORE_QUANTUM_DEPTH == 32 || MAGICKCORE_QUANTUM_DEPTH == 64
966
966
  case 32:
967
- #if QuantumDepth == 64
967
+ #if MAGICKCORE_QUANTUM_DEPTH == 64
968
968
  case 64:
969
969
  #endif
970
970
  #endif
@@ -1359,14 +1359,14 @@ VALUE Info_format(VALUE self)
1359
1359
  {
1360
1360
  Info *info;
1361
1361
  const MagickInfo *magick_info ;
1362
- ExceptionInfo exception;
1362
+ ExceptionInfo *exception;
1363
1363
 
1364
1364
  Data_Get_Struct(self, Info, info);
1365
1365
  if (*info->magick)
1366
1366
  {
1367
- GetExceptionInfo(&exception);
1368
- magick_info = GetMagickInfo(info->magick, &exception);
1369
- (void) DestroyExceptionInfo(&exception);
1367
+ exception = AcquireExceptionInfo();
1368
+ magick_info = GetMagickInfo(info->magick, exception);
1369
+ (void) DestroyExceptionInfo(exception);
1370
1370
 
1371
1371
  return magick_info ? rb_str_new2(magick_info->name) : Qnil;
1372
1372
  }
@@ -1390,16 +1390,16 @@ Info_format_eq(VALUE self, VALUE magick)
1390
1390
  Info *info;
1391
1391
  const MagickInfo *m;
1392
1392
  char *mgk;
1393
- ExceptionInfo exception;
1393
+ ExceptionInfo *exception;
1394
1394
 
1395
1395
  Data_Get_Struct(self, Info, info);
1396
1396
 
1397
- GetExceptionInfo(&exception);
1397
+ exception = AcquireExceptionInfo();
1398
1398
 
1399
1399
  mgk = StringValuePtr(magick);
1400
- m = GetMagickInfo(mgk, &exception);
1400
+ m = GetMagickInfo(mgk, exception);
1401
1401
  CHECK_EXCEPTION()
1402
- (void) DestroyExceptionInfo(&exception);
1402
+ (void) DestroyExceptionInfo(exception);
1403
1403
 
1404
1404
  if (!m)
1405
1405
  {
data/ext/RMagick/rmmain.c CHANGED
@@ -22,6 +22,7 @@ void Init_RMagick(void);
22
22
 
23
23
  static void test_Magick_version(void);
24
24
  static void version_constants(void);
25
+ static void features_constant(void);
25
26
 
26
27
 
27
28
 
@@ -431,6 +432,8 @@ Init_RMagick2(void)
431
432
  rb_define_method(Class_Image, "random_threshold_channel", Image_random_threshold_channel, -1);
432
433
  rb_define_method(Class_Image, "recolor", Image_recolor, 1);
433
434
  rb_define_method(Class_Image, "reduce_noise", Image_reduce_noise, 1);
435
+ rb_define_method(Class_Image, "resample", Image_resample, -1);
436
+ rb_define_method(Class_Image, "resample!", Image_resample_bang, -1);
434
437
  rb_define_method(Class_Image, "resize", Image_resize, -1);
435
438
  rb_define_method(Class_Image, "resize!", Image_resize_bang, -1);
436
439
  rb_define_method(Class_Image, "roll", Image_roll, 2);
@@ -818,13 +821,13 @@ Init_RMagick2(void)
818
821
 
819
822
 
820
823
  // Miscellaneous fixed-point constants
821
- DEF_CONST(MaxRGB);
822
824
  DEF_CONST(QuantumRange);
823
- DEF_CONST(QuantumDepth);
825
+ DEF_CONST(MAGICKCORE_QUANTUM_DEPTH);
824
826
  DEF_CONST(OpaqueOpacity);
825
827
  DEF_CONST(TransparentOpacity);
826
828
 
827
829
  version_constants();
830
+ features_constant();
828
831
 
829
832
  /*-----------------------------------------------------------------------*/
830
833
  /* Class Magick::Enum */
@@ -946,7 +949,7 @@ Init_RMagick2(void)
946
949
  ENUMERATOR(HSLColorspace)
947
950
  ENUMERATOR(HWBColorspace)
948
951
  ENUMERATOR(HSBColorspace)
949
- ENUMERATOR(LABColorspace)
952
+ ENUMERATOR(LabColorspace)
950
953
  ENUMERATOR(Rec601LumaColorspace)
951
954
  ENUMERATOR(Rec601YCbCrColorspace)
952
955
  ENUMERATOR(Rec709LumaColorspace)
@@ -1703,3 +1706,24 @@ version_constants(void)
1703
1706
  rb_define_const(Module_Magick, "Long_version", str);
1704
1707
 
1705
1708
  }
1709
+
1710
+
1711
+ /**
1712
+ * Create Features constant.
1713
+ *
1714
+ * No Ruby usage (internal function)
1715
+ */
1716
+ static void
1717
+ features_constant(void)
1718
+ {
1719
+ volatile VALUE features;
1720
+
1721
+ #if defined(HAVE_GETMAGICKFEATURES)
1722
+ features = rb_str_new2(GetMagickFeatures());
1723
+ #else
1724
+ features = rb_str_new2(MagickSupport);
1725
+ #endif
1726
+
1727
+ rb_obj_freeze(features);
1728
+ rb_define_const(Module_Magick, "Magick_features", features);
1729
+ }
@@ -217,12 +217,12 @@ Color_Name_to_PixelPacket(PixelPacket *color, VALUE name_arg)
217
217
  {
218
218
  MagickBooleanType okay;
219
219
  char *name;
220
- ExceptionInfo exception;
220
+ ExceptionInfo *exception;
221
221
 
222
- GetExceptionInfo(&exception);
222
+ exception = AcquireExceptionInfo();
223
223
  name = StringValuePtr(name_arg);
224
- okay = QueryColorDatabase(name, color, &exception);
225
- (void) DestroyExceptionInfo(&exception);
224
+ okay = QueryColorDatabase(name, color, exception);
225
+ (void) DestroyExceptionInfo(exception);
226
226
  if (!okay)
227
227
  {
228
228
  rb_raise(rb_eArgError, "invalid color name %s", name);
@@ -444,15 +444,15 @@ VALUE
444
444
  Pixel_from_color(VALUE class, VALUE name)
445
445
  {
446
446
  PixelPacket pp;
447
- ExceptionInfo exception;
447
+ ExceptionInfo *exception;
448
448
  MagickBooleanType okay;
449
449
 
450
450
  class = class; // defeat "never referenced" message from icc
451
451
 
452
- GetExceptionInfo(&exception);
453
- okay = QueryColorDatabase(StringValuePtr(name), &pp, &exception);
452
+ exception = AcquireExceptionInfo();
453
+ okay = QueryColorDatabase(StringValuePtr(name), &pp, exception);
454
454
  CHECK_EXCEPTION()
455
- (void) DestroyExceptionInfo(&exception);
455
+ (void) DestroyExceptionInfo(exception);
456
456
 
457
457
  if (!okay)
458
458
  {
@@ -488,7 +488,7 @@ Pixel_from_hsla(int argc, VALUE *argv, VALUE class)
488
488
  {
489
489
  double h, s, l, a = 1.0;
490
490
  MagickPixelPacket pp;
491
- ExceptionInfo exception;
491
+ ExceptionInfo *exception;
492
492
  char name[50];
493
493
  MagickBooleanType alpha = MagickFalse;
494
494
 
@@ -502,7 +502,7 @@ Pixel_from_hsla(int argc, VALUE *argv, VALUE class)
502
502
  case 3:
503
503
  // saturation and lightness are out of 255 in new ImageMagicks and
504
504
  // out of 100 in old ImageMagicks. Compromise: always use %.
505
- l = rm_percentage(argv[2],255.0);
505
+ l = rm_percentage(argv[2],255.0);
506
506
  s = rm_percentage(argv[1],255.0);
507
507
  h = rm_percentage(argv[0],360.0);
508
508
  break;
@@ -547,12 +547,12 @@ Pixel_from_hsla(int argc, VALUE *argv, VALUE class)
547
547
  sprintf(name, "hsl(%-2.1f,%-2.1f,%-2.1f)", h, s, l);
548
548
  }
549
549
 
550
- GetExceptionInfo(&exception);
550
+ exception = AcquireExceptionInfo();
551
551
 
552
- (void) QueryMagickColor(name, &pp, &exception);
552
+ (void) QueryMagickColor(name, &pp, exception);
553
553
  CHECK_EXCEPTION()
554
554
 
555
- (void) DestroyExceptionInfo(&exception);
555
+ (void) DestroyExceptionInfo(exception);
556
556
 
557
557
  return Pixel_from_MagickPixelPacket(&pp);
558
558
  }
@@ -666,10 +666,8 @@ Pixel_hash(VALUE self)
666
666
  hash += ScaleQuantumToChar(pixel->green) << 16;
667
667
  hash += ScaleQuantumToChar(pixel->blue) << 8;
668
668
  hash += ScaleQuantumToChar(pixel->opacity);
669
- hash >>= 1;
670
-
671
- return INT2FIX(hash);
672
669
 
670
+ return UINT2NUM(hash >> 1);
673
671
  }
674
672
 
675
673
 
@@ -877,7 +875,7 @@ Pixel_spaceship(VALUE self, VALUE other)
877
875
  /**
878
876
  * Return [hue, saturation, lightness, alpha] in the same ranges as
879
877
  * Pixel_from_hsla.
880
- *
878
+ *
881
879
  *
882
880
  * Ruby usage:
883
881
  * - @verbatim Pixel#to_hsla @endverbatim
@@ -913,7 +911,7 @@ Pixel_to_hsla(VALUE self)
913
911
  }
914
912
  else
915
913
  {
916
- alpha = ROUND_TO_QUANTUM(QuantumRange - (pixel->opacity / QuantumRange));
914
+ alpha = (double)(QuantumRange - pixel->opacity) / (double)QuantumRange;
917
915
  }
918
916
 
919
917
  hsla = rb_ary_new3(4, rb_float_new(hue), rb_float_new(sat), rb_float_new(lum), rb_float_new(alpha));
@@ -962,7 +960,7 @@ Pixel_to_HSL(VALUE self)
962
960
  * Notes:
963
961
  * - Default compliance is AllCompliance
964
962
  * - Default matte is false
965
- * - Default depth is QuantumDepth
963
+ * - Default depth is MAGICKCORE_QUANTUM_DEPTH
966
964
  * - Default hex is false
967
965
  * - The conversion respects the value of the 'opacity' field in the Pixel
968
966
  *
@@ -980,10 +978,10 @@ Pixel_to_color(int argc, VALUE *argv, VALUE self)
980
978
  MagickPixelPacket mpp;
981
979
  MagickBooleanType hex = MagickFalse;
982
980
  char name[MaxTextExtent];
983
- ExceptionInfo exception;
981
+ ExceptionInfo *exception;
984
982
  ComplianceType compliance = AllCompliance;
985
983
  unsigned int matte = MagickFalse;
986
- unsigned int depth = QuantumDepth;
984
+ unsigned int depth = MAGICKCORE_QUANTUM_DEPTH;
987
985
 
988
986
  switch (argc)
989
987
  {
@@ -996,10 +994,10 @@ Pixel_to_color(int argc, VALUE *argv, VALUE self)
996
994
  switch (depth)
997
995
  {
998
996
  case 8:
999
- #if QuantumDepth == 16 || QuantumDepth == 32
997
+ #if MAGICKCORE_QUANTUM_DEPTH == 16 || MAGICKCORE_QUANTUM_DEPTH == 32
1000
998
  case 16:
1001
999
  #endif
1002
- #if QuantumDepth == 32
1000
+ #if MAGICKCORE_QUANTUM_DEPTH == 32
1003
1001
  case 32:
1004
1002
  #endif
1005
1003
  break;
@@ -1028,7 +1026,7 @@ Pixel_to_color(int argc, VALUE *argv, VALUE self)
1028
1026
  GetMagickPixelPacket(image, &mpp);
1029
1027
  rm_set_magick_pixel_packet(pixel, &mpp);
1030
1028
 
1031
- GetExceptionInfo(&exception);
1029
+ exception = AcquireExceptionInfo();
1032
1030
 
1033
1031
  #if defined(HAVE_NEW_QUERYMAGICKCOLORNAME)
1034
1032
  // Support for hex-format color names moved out of QueryMagickColorname
@@ -1044,14 +1042,14 @@ Pixel_to_color(int argc, VALUE *argv, VALUE self)
1044
1042
  }
1045
1043
  else
1046
1044
  {
1047
- (void) QueryMagickColorname(image, &mpp, compliance, name, &exception);
1045
+ (void) QueryMagickColorname(image, &mpp, compliance, name, exception);
1048
1046
  }
1049
1047
  #else
1050
- (void) QueryMagickColorname(image, &mpp, compliance, hex, name, &exception);
1048
+ (void) QueryMagickColorname(image, &mpp, compliance, hex, name, exception);
1051
1049
  #endif
1052
1050
  (void) DestroyImage(image);
1053
1051
  CHECK_EXCEPTION()
1054
- (void) DestroyExceptionInfo(&exception);
1052
+ (void) DestroyExceptionInfo(exception);
1055
1053
 
1056
1054
  // Always return a string, even if it's ""
1057
1055
  return rb_str_new2(name);
@@ -347,7 +347,7 @@ Color_to_s(VALUE self)
347
347
  Export_ColorInfo(&ci, self);
348
348
 
349
349
  sprintf(buff, "name=%s, compliance=%s, "
350
- #if (QuantumDepth == 32 || QuantumDepth == 64) && defined(HAVE_TYPE_LONG_DOUBLE)
350
+ #if (MAGICKCORE_QUANTUM_DEPTH == 32 || MAGICKCORE_QUANTUM_DEPTH == 64) && defined(HAVE_TYPE_LONG_DOUBLE)
351
351
  "color.red=%Lg, color.green=%Lg, color.blue=%Lg, color.opacity=%Lg ",
352
352
  #else
353
353
  "color.red=%g, color.green=%g, color.blue=%g, color.opacity=%g ",
data/ext/RMagick/rmutil.c CHANGED
@@ -627,13 +627,13 @@ VALUE
627
627
  rm_pixelpacket_to_color_name(Image *image, PixelPacket *color)
628
628
  {
629
629
  char name[MaxTextExtent];
630
- ExceptionInfo exception;
630
+ ExceptionInfo *exception;
631
631
 
632
- GetExceptionInfo(&exception);
632
+ exception = AcquireExceptionInfo();
633
633
 
634
- (void) QueryColorname(image, color, X11Compliance, name, &exception);
634
+ (void) QueryColorname(image, color, X11Compliance, name, exception);
635
635
  CHECK_EXCEPTION()
636
- (void) DestroyExceptionInfo(&exception);
636
+ (void) DestroyExceptionInfo(exception);
637
637
 
638
638
  return rb_str_new2(name);
639
639
  }
@@ -698,11 +698,11 @@ rm_write_temp_image(Image *image, char *temp_name)
698
698
  #define TMPNAM_CLASS_VAR "@@_tmpnam_"
699
699
 
700
700
  MagickBooleanType okay;
701
- ExceptionInfo exception;
701
+ ExceptionInfo *exception;
702
702
  volatile VALUE id_value;
703
703
  int id;
704
704
 
705
- GetExceptionInfo(&exception);
705
+ exception = AcquireExceptionInfo();
706
706
 
707
707
 
708
708
  // 'id' is always the value of its previous use
@@ -722,9 +722,9 @@ rm_write_temp_image(Image *image, char *temp_name)
722
722
  sprintf(temp_name, "mpri:%d", id);
723
723
 
724
724
  // Omit "mpri:" from filename to form the key
725
- okay = SetImageRegistry(ImageRegistryType, temp_name+5, image, &exception);
725
+ okay = SetImageRegistry(ImageRegistryType, temp_name+5, image, exception);
726
726
  CHECK_EXCEPTION()
727
- DestroyExceptionInfo(&exception);
727
+ DestroyExceptionInfo(exception);
728
728
  if (!okay)
729
729
  {
730
730
  rb_raise(rb_eRuntimeError, "SetImageRegistry failed.");
@@ -1389,16 +1389,16 @@ Image *
1389
1389
  rm_clone_image(Image *image)
1390
1390
  {
1391
1391
  Image *clone;
1392
- ExceptionInfo exception;
1392
+ ExceptionInfo *exception;
1393
1393
 
1394
- GetExceptionInfo(&exception);
1395
- clone = CloneImage(image, 0, 0, MagickTrue, &exception);
1394
+ exception = AcquireExceptionInfo();
1395
+ clone = CloneImage(image, 0, 0, MagickTrue, exception);
1396
1396
  if (!clone)
1397
1397
  {
1398
1398
  rb_raise(rb_eNoMemError, "not enough memory to continue");
1399
1399
  }
1400
- rm_check_exception(&exception, clone, DestroyOnError);
1401
- (void) DestroyExceptionInfo(&exception);
1400
+ rm_check_exception(exception, clone, DestroyOnError);
1401
+ (void) DestroyExceptionInfo(exception);
1402
1402
 
1403
1403
  return clone;
1404
1404
  }
@@ -1486,7 +1486,7 @@ rm_split(Image *image)
1486
1486
  void
1487
1487
  rm_check_image_exception(Image *imglist, ErrorRetention retention)
1488
1488
  {
1489
- ExceptionInfo exception;
1489
+ ExceptionInfo *exception;
1490
1490
  Image *badboy = NULL;
1491
1491
  Image *image;
1492
1492
 
@@ -1495,7 +1495,7 @@ rm_check_image_exception(Image *imglist, ErrorRetention retention)
1495
1495
  return;
1496
1496
  }
1497
1497
 
1498
- GetExceptionInfo(&exception);
1498
+ exception = AcquireExceptionInfo();
1499
1499
 
1500
1500
  // Find the image with the highest severity
1501
1501
  image = GetFirstImageInList(imglist);
@@ -1506,7 +1506,7 @@ rm_check_image_exception(Image *imglist, ErrorRetention retention)
1506
1506
  if (!badboy || image->exception.severity > badboy->exception.severity)
1507
1507
  {
1508
1508
  badboy = image;
1509
- InheritException(&exception, &badboy->exception);
1509
+ InheritException(exception, &badboy->exception);
1510
1510
  }
1511
1511
 
1512
1512
  ClearMagickException(&image->exception);
@@ -1516,10 +1516,10 @@ rm_check_image_exception(Image *imglist, ErrorRetention retention)
1516
1516
 
1517
1517
  if (badboy)
1518
1518
  {
1519
- rm_check_exception(&exception, imglist, retention);
1519
+ rm_check_exception(exception, imglist, retention);
1520
1520
  }
1521
1521
 
1522
- (void) DestroyExceptionInfo(&exception);
1522
+ (void) DestroyExceptionInfo(exception);
1523
1523
  }
1524
1524
 
1525
1525