rmagick 2.13.2 → 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 +47 -4
  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 +59 -30
  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 +738 -547
  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 +373 -322
  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 -76
data/doc/rvgtext.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <meta name="generator" content=
7
7
  "HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org" />
8
8
 
9
- <title>RMagick 2.13.2: RVG Reference: RVG::Text Class</title>
9
+ <title>RMagick 0.0.0: RVG Reference: RVG::Text Class</title>
10
10
  <meta http-equiv="Content-Type" content=
11
11
  "text/html; charset=us-ascii" />
12
12
  <meta name="GENERATOR" content="Quanta Plus" />
@@ -33,7 +33,7 @@
33
33
  </head>
34
34
 
35
35
  <body>
36
- <h6 id="header">RMagick 2.13.2 User's Guide and Reference</h6>
36
+ <h6 id="header">RMagick 0.0.0 User's Guide and Reference</h6>
37
37
 
38
38
  <div class="nav">
39
39
  &laquo;&nbsp;<a href="rvgclip.html">Prev</a> | <a href=
data/doc/rvgtspan.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <meta name="generator" content=
7
7
  "HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org" />
8
8
 
9
- <title>RMagick 2.13.2: RVG Reference: RVG::Tspan Class</title>
9
+ <title>RMagick 0.0.0: RVG Reference: RVG::Tspan Class</title>
10
10
  <meta http-equiv="Content-Type" content=
11
11
  "text/html; charset=us-ascii" />
12
12
  <meta name="GENERATOR" content="Quanta Plus" />
@@ -27,7 +27,7 @@
27
27
  </head>
28
28
 
29
29
  <body>
30
- <h6 id="header">RMagick 2.13.2 User's Guide and Reference</h6>
30
+ <h6 id="header">RMagick 0.0.0 User's Guide and Reference</h6>
31
31
 
32
32
  <div class="nav">
33
33
  &laquo;&nbsp;<a href="rvgtext.html">Prev</a> | <a href=
data/doc/rvgtut.html CHANGED
@@ -9,7 +9,7 @@
9
9
  <meta name="generator" content=
10
10
  "HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org" />
11
11
 
12
- <title>RMagick 2.13.2: RVG Tutorial</title>
12
+ <title>RMagick 0.0.0: RVG Tutorial</title>
13
13
  <meta name="GENERATOR" content="Quanta Plus" />
14
14
  <link rel="stylesheet" type="text/css" href="css/doc.css" />
15
15
  <style type="text/css">
@@ -23,7 +23,7 @@
23
23
  </head>
24
24
 
25
25
  <body>
26
- <h6 id="header">RMagick 2.13.2 User's Guide and Reference</h6>
26
+ <h6 id="header">RMagick 0.0.0 User's Guide and Reference</h6>
27
27
 
28
28
  <div class="nav">
29
29
  &laquo;&nbsp;<a href="constants.html">Prev</a> | <a href=
data/doc/rvguse.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <meta name="generator" content=
7
7
  "HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org" />
8
8
 
9
- <title>RMagick 2.13.2: RVG Reference: RVG::Use Class</title>
9
+ <title>RMagick 0.0.0: RVG Reference: RVG::Use Class</title>
10
10
  <meta http-equiv="Content-Type" content=
11
11
  "text/html; charset=us-ascii" />
12
12
  <meta name="GENERATOR" content="Quanta Plus" />
@@ -27,7 +27,7 @@
27
27
  </head>
28
28
 
29
29
  <body>
30
- <h6 id="header">RMagick 2.13.2 User's Guide and Reference</h6>
30
+ <h6 id="header">RMagick 0.0.0 User's Guide and Reference</h6>
31
31
 
32
32
  <div class="nav">
33
33
  &laquo;&nbsp;<a href="rvgtspan.html">Prev</a> | <a href=
data/doc/rvgxform.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <meta name="generator" content=
7
7
  "HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org" />
8
8
 
9
- <title>RMagick 2.13.2: RVG Reference: Transforms</title>
9
+ <title>RMagick 0.0.0: RVG Reference: Transforms</title>
10
10
  <meta http-equiv="Content-Type" content=
11
11
  "text/html; charset=us-ascii" />
12
12
  <meta name="GENERATOR" content="Quanta Plus" />
@@ -28,7 +28,7 @@
28
28
  </head>
29
29
 
30
30
  <body>
31
- <h6 id="header">RMagick 2.13.2 User's Guide and Reference</h6>
31
+ <h6 id="header">RMagick 0.0.0 User's Guide and Reference</h6>
32
32
 
33
33
  <div class="nav">
34
34
  &laquo;&nbsp;<a href="rvgshape.html">Prev</a> | <a href=
data/doc/struct.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <meta name="generator" content=
7
7
  "HTML Tidy for Linux/x86 (vers 6 November 2007), see www.w3.org" />
8
8
 
9
- <title>RMagick 2.13.2: Miscellaneous classes</title>
9
+ <title>RMagick 0.0.0: Miscellaneous classes</title>
10
10
  <meta http-equiv="Content-Type" content=
11
11
  "text/html; charset=us-ascii" />
12
12
  <meta name="GENERATOR" content="Quanta Plus" />
@@ -27,7 +27,7 @@
27
27
  </head>
28
28
 
29
29
  <body>
30
- <h6 id="header">RMagick 2.13.2 User's Guide and Reference</h6>
30
+ <h6 id="header">RMagick 0.0.0 User's Guide and Reference</h6>
31
31
 
32
32
  <div class="nav">
33
33
  &laquo;&nbsp;<a href="draw.html">Prev</a> | <a href=
data/doc/usage.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <meta name="generator" content=
7
7
  "HTML Tidy for Linux/x86 (vers 7 December 2008), see www.w3.org" />
8
8
 
9
- <title>RMagick 2.13.2: How to use RMagick</title>
9
+ <title>RMagick 0.0.0: How to use RMagick</title>
10
10
  <meta http-equiv="Content-Type" content=
11
11
  "text/html; charset=us-ascii" />
12
12
  <meta name="GENERATOR" content="Quanta Plus" />
@@ -90,7 +90,7 @@
90
90
  </head>
91
91
 
92
92
  <body>
93
- <h6 id="header">RMagick 2.13.2 User's Guide and Reference</h6>
93
+ <h6 id="header">RMagick 0.0.0 User's Guide and Reference</h6>
94
94
 
95
95
  <div class="nav">
96
96
  &laquo;&nbsp;<a href="index.html">Prev</a> | <a href=
File without changes
data/examples/demo.rb CHANGED
File without changes
data/examples/describe.rb CHANGED
File without changes
data/examples/identify.rb CHANGED
@@ -32,7 +32,7 @@ module Magick
32
32
  puts "\t\tGray: #{channel_depth(Magick::GrayChannel)}-bits\n"
33
33
  puts "\t\tOpacity: #{channel_depth(Magick::OpacityChannel)}-bits\n" if matte
34
34
  end
35
- scale = Magick::QuantumRange / (Magick::QuantumRange >> (Magick::QuantumDepth-channel_depth))
35
+ scale = Magick::QuantumRange / (Magick::QuantumRange >> (Magick::MAGICKCORE_QUANTUM_DEPTH-channel_depth))
36
36
  puts "\tChannel statistics:\n"
37
37
  case color_space
38
38
  when Magick::RGBColorspace
File without changes
@@ -1,14 +1,14 @@
1
1
  require "mkmf"
2
2
  require "date"
3
3
 
4
- RMAGICK_VERS = "2.13.2"
5
- MIN_RUBY_VERS = "1.8.5"
4
+ require_relative '../../lib/rmagick/version'
5
+
6
+ RMAGICK_VERS = Magick::VERSION
7
+ MIN_RUBY_VERS = Magick::MIN_RUBY_VERSION
6
8
  MIN_RUBY_VERS_NO = MIN_RUBY_VERS.tr(".","").to_i
7
- MIN_IM_VERS = "6.4.9"
9
+ MIN_IM_VERS = Magick::MIN_IM_VERSION
8
10
  MIN_IM_VERS_NO = MIN_IM_VERS.tr(".","").to_i
9
11
 
10
-
11
-
12
12
  # Test for a specific value in an enum type
13
13
  def have_enum_value(enum, value, headers=nil, &b)
14
14
  checking_for "#{enum}.#{value}" do
@@ -131,9 +131,17 @@ if RUBY_PLATFORM !~ /mswin|mingw/
131
131
  exit_failure "No C compiler found in ${ENV['PATH']}. See mkmf.log for details."
132
132
  end
133
133
 
134
+ # ugly way to handle which config tool we're going to use...
135
+ $magick_config = false
136
+ $pkg_config = false
137
+
134
138
  # Check for Magick-config
135
- unless find_executable("Magick-config")
136
- exit_failure "Can't install RMagick #{RMAGICK_VERS}. Can't find Magick-config in #{ENV['PATH']}\n"
139
+ if find_executable("Magick-config")
140
+ $magick_config = true
141
+ elsif find_executable("pkg-config")
142
+ $pkg_config = true
143
+ else
144
+ exit_failure "Can't install RMagick #{RMAGICK_VERS}. Can't find Magick-config or pkg-config in #{ENV['PATH']}\n"
137
145
  end
138
146
 
139
147
  check_multiple_imagemagick_versions()
@@ -141,38 +149,48 @@ if RUBY_PLATFORM !~ /mswin|mingw/
141
149
 
142
150
  # Ensure minimum ImageMagick version
143
151
  unless checking_for("ImageMagick version >= #{MIN_IM_VERS}") do
144
- version = `Magick-config --version`.chomp.tr(".","").to_i
145
- version >= MIN_IM_VERS_NO
152
+ # extract version info from convert binary (could use identify as well)
153
+ convert_version_string = /^Version: ImageMagick\s+(?<Version>\d+\.\d+\.\d+\-\d+)\s+(?<Unknown>\S+)\s+(?<Arch>\S+)\s+(?<Date>\S+)/
154
+ match_data = `convert -version`.match(convert_version_string)
155
+ unless match_data.nil?
156
+ # taken from previous version, this doesn't look right though
157
+ # for example 6.8.12 whould show as greater than 6.12.9
158
+ # is there some property of imagemagick versioning that prevents this situation?
159
+ version = match_data['Version'].chomp.tr(".","").to_i
160
+ version >= MIN_IM_VERS_NO
161
+ end
146
162
  end
147
163
  exit_failure "Can't install RMagick #{RMAGICK_VERS}. You must have ImageMagick #{MIN_IM_VERS} or later.\n"
148
164
  end
149
165
 
150
166
 
151
-
152
-
153
- $magick_version = `Magick-config --version`.chomp
154
-
155
- # Ensure ImageMagick is not configured for HDRI
156
- unless checking_for("HDRI disabled version of ImageMagick") do
157
- not (`Magick-config --version`["HDRI"])
158
- end
159
- exit_failure "\nCan't install RMagick #{RMAGICK_VERS}."+
160
- "\nRMagick does not work when ImageMagick is configured for High Dynamic Range Images."+
161
- "\nDon't use the --enable-hdri option when configuring ImageMagick.\n"
167
+ # either set flags using Magick-config or pkg-config (new Debian default)
168
+ if $magick_config
169
+ # Save flags
170
+ $CFLAGS = ENV["CFLAGS"].to_s + " " + `Magick-config --cflags`.chomp
171
+ $CPPFLAGS = ENV["CPPFLAGS"].to_s + " " + `Magick-config --cppflags`.chomp
172
+ $LDFLAGS = ENV["LDFLAGS"].to_s + " " + `Magick-config --ldflags`.chomp
173
+ $LOCAL_LIBS = ENV["LIBS"].to_s + " " + `Magick-config --libs`.chomp
162
174
  end
163
175
 
164
- # Save flags
165
- $CFLAGS = ENV["CFLAGS"].to_s + " " + `Magick-config --cflags`.chomp
166
- $CPPFLAGS = ENV["CPPFLAGS"].to_s + " " + `Magick-config --cppflags`.chomp
167
- $LDFLAGS = ENV["LDFLAGS"].to_s + " " + `Magick-config --ldflags`.chomp
168
- $LOCAL_LIBS = ENV["LIBS"].to_s + " " + `Magick-config --libs`.chomp
176
+ if $pkg_config
177
+ # Save flags
178
+ $CFLAGS = ENV["CFLAGS"].to_s + " " + `pkg-config --cflags MagickCore`.chomp
179
+ $CPPFLAGS = ENV["CPPFLAGS"].to_s + " " + `pkg-config --cflags MagickCore`.chomp
180
+ $LDFLAGS = ENV["LDFLAGS"].to_s + " " + `pkg-config --libs MagickCore`.chomp
181
+ $LOCAL_LIBS = ENV["LIBS"].to_s + " " + `pkg-config --libs MagickCore`.chomp
182
+ end
169
183
 
170
184
  elsif RUBY_PLATFORM =~ /mingw/ # mingw
171
185
 
172
186
  `convert -version` =~ /Version: ImageMagick (\d+\.\d+\.\d+)-\d+ /
173
187
  abort "Unable to get ImageMagick version" unless $1
174
188
  $magick_version = $1
175
- $LOCAL_LIBS = '-lCORE_RL_magick_ -lX11'
189
+ if RUBY_PLATFORM =~ /x64/
190
+ $LOCAL_LIBS = '-lCORE_RL_magick_'
191
+ else
192
+ $LOCAL_LIBS = '-lCORE_RL_magick_ -lX11'
193
+ end
176
194
 
177
195
  else # mswin
178
196
 
@@ -205,10 +223,13 @@ end
205
223
 
206
224
  if RUBY_PLATFORM !~ /mswin|mingw/
207
225
 
208
- unless `Magick-config --libs`[/\bl\s*(MagickCore|Magick)\b/]
209
- exit_failure "Can't install RMagick #{RMAGICK_VERS}. " +
210
- "Can't find the ImageMagick library or one of the dependent libraries. " +
211
- "Check the mkmf.log file for more detailed information.\n"
226
+ # check for pkg-config if Magick-config doesn't exist
227
+ if $magick_config && `Magick-config --libs`[/\bl\s*(MagickCore|Magick)6?\b/]
228
+ elsif $pkg_config && `pkg-config --libs MagickCore`[/\bl\s*(MagickCore|Magick)6?\b/]
229
+ else
230
+ exit_failure "Can't install RMagick #{RMAGICK_VERS}. " +
231
+ "Can't find the ImageMagick library or one of the dependent libraries. " +
232
+ "Check the mkmf.log file for more detailed information.\n"
212
233
  end
213
234
  end
214
235
 
@@ -220,15 +241,19 @@ have_func("snprintf", headers)
220
241
  "AutoGammaImageChannel", # 6.5.5-1
221
242
  "AutoLevelImageChannel", # 6.5.5-1
222
243
  "BlueShiftImage", # 6.5.4-3
244
+ "ColorMatrixImage", # 6.6.1-0
223
245
  "ConstituteComponentTerminus", # 6.5.7-9
224
246
  "DeskewImage", # 6.4.2-5
247
+ "DestroyConstitute", # 6.5.7-9(deprecated)
225
248
  "EncipherImage", # 6.3.8-6
226
249
  "EqualizeImageChannel", # 6.3.6-9
250
+ "EvaluateImages", # 6.8.6-4
227
251
  "FloodfillPaintImage", # 6.3.7
228
252
  "FunctionImageChannel", # 6.4.8-8
229
253
  "GetAuthenticIndexQueue", # 6.4.5-6
230
254
  "GetAuthenticPixels", # 6.4.5-6
231
255
  "GetImageAlphaChannel", # 6.3.9-2
256
+ "GetMagickFeatures", # 6.5.7-1
232
257
  "GetVirtualPixels", # 6.4.5-6
233
258
  "LevelImageColors", # 6.4.2
234
259
  "LevelColorsImageChannel", # 6.5.6-4
@@ -238,12 +263,16 @@ have_func("snprintf", headers)
238
263
  "OpaquePaintImageChannel", # 6.3.7-10
239
264
  "QueueAuthenticPixels", # 6.4.5-6
240
265
  "RemapImage", # 6.4.4-0
266
+ "RemapImages", # 6.4.4-0
241
267
  "RemoveImageArtifact", # 6.3.6
268
+ "RotationalBlurImage", # 6.8.8-9
269
+ "RotationalBlurImageChannel", # 6.8.8-9
242
270
  "SelectiveBlurImageChannel", # 6.5.0-3
243
271
  "SetImageAlphaChannel", # 6.3.6-9
244
272
  "SetImageArtifact", # 6.3.6
245
273
  "SetMagickMemoryMethods", # 6.4.1
246
274
  "SparseColorImage", # 6.3.6-?
275
+ "StatisticImage", # 6.6.8-6
247
276
  "SyncAuthenticPixels", # 6.4.5-6
248
277
  "TransformImageColorspace", # 6.5.1
249
278
  "TransparentPaintImage", # 6.3.7-10
@@ -33,15 +33,15 @@ VALUE
33
33
  Magick_colors(VALUE class)
34
34
  {
35
35
  const ColorInfo **color_info_list;
36
- unsigned long number_colors, x;
36
+ size_t number_colors, x;
37
37
  volatile VALUE ary;
38
- ExceptionInfo exception;
38
+ ExceptionInfo *exception;
39
39
 
40
- GetExceptionInfo(&exception);
40
+ exception = AcquireExceptionInfo();
41
41
 
42
- color_info_list = GetColorInfoList("*", &number_colors, &exception);
42
+ color_info_list = GetColorInfoList("*", &number_colors, exception);
43
43
  CHECK_EXCEPTION()
44
- (void) DestroyExceptionInfo(&exception);
44
+ (void) DestroyExceptionInfo(exception);
45
45
 
46
46
 
47
47
  if (rb_block_given_p())
@@ -82,14 +82,14 @@ VALUE
82
82
  Magick_fonts(VALUE class)
83
83
  {
84
84
  const TypeInfo **type_info;
85
- unsigned long number_types, x;
85
+ size_t number_types, x;
86
86
  volatile VALUE ary;
87
- ExceptionInfo exception;
87
+ ExceptionInfo *exception;
88
88
 
89
- GetExceptionInfo(&exception);
90
- type_info = GetTypeInfoList("*", &number_types, &exception);
89
+ exception = AcquireExceptionInfo();
90
+ type_info = GetTypeInfoList("*", &number_types, exception);
91
91
  CHECK_EXCEPTION()
92
- (void) DestroyExceptionInfo(&exception);
92
+ (void) DestroyExceptionInfo(exception);
93
93
 
94
94
  if (rb_block_given_p())
95
95
  {
@@ -166,18 +166,18 @@ VALUE
166
166
  Magick_init_formats(VALUE class)
167
167
  {
168
168
  const MagickInfo **magick_info;
169
- unsigned long number_formats, x;
169
+ size_t number_formats, x;
170
170
  volatile VALUE formats;
171
- ExceptionInfo exception;
171
+ ExceptionInfo *exception;
172
172
 
173
173
  class = class; // defeat "never referenced" message from icc
174
174
  formats = rb_hash_new();
175
175
 
176
176
  // IM 6.1.3 added an exception argument to GetMagickInfoList
177
- GetExceptionInfo(&exception);
178
- magick_info = GetMagickInfoList("*", &number_formats, &exception);
177
+ exception = AcquireExceptionInfo();
178
+ magick_info = GetMagickInfoList("*", &number_formats, exception);
179
179
  CHECK_EXCEPTION()
180
- (void) DestroyExceptionInfo(&exception);
180
+ (void) DestroyExceptionInfo(exception);
181
181
 
182
182
 
183
183
  for (x = 0; x < number_formats; x++)
@@ -68,17 +68,17 @@
68
68
 
69
69
 
70
70
  // Handle Quantum <-> Ruby Numeric object conversion
71
- #if (QuantumDepth == 8 || QuantumDepth == 16)
71
+ #if (MAGICKCORE_QUANTUM_DEPTH == 8 || MAGICKCORE_QUANTUM_DEPTH == 16)
72
72
  #define QUANTUM2NUM(q) INT2FIX((q)) /**< Quantum -> Ruby Numeric conversion */
73
73
  #define NUM2QUANTUM(n) (Quantum)NUM2UINT((n)) /**< Quantum <- Ruby Numeric conversion */
74
- #elif (QuantumDepth == 32)
74
+ #elif (MAGICKCORE_QUANTUM_DEPTH == 32)
75
75
  #define QUANTUM2NUM(q) UINT2NUM((q)) /**< Quantum -> Ruby Numeric conversion */
76
76
  #define NUM2QUANTUM(n) (Quantum)NUM2UINT((n)) /**< Quntum <- Ruby Numeric conversion */
77
- #elif (QuantumDepth == 64)
77
+ #elif (MAGICKCORE_QUANTUM_DEPTH == 64)
78
78
  #define QUANTUM2NUM(q) ULL2NUM((q)) /**< Quantum -> Ruby Numeric conversion */
79
79
  #define NUM2QUANTUM(n) (Quantum)NUM2ULL((n)) /**< Quntum <- Ruby Numeric conversion */
80
80
  #else
81
- #error Specified QuantumDepth is not supported.
81
+ #error Specified MAGICKCORE_QUANTUM_DEPTH is not supported.
82
82
  #endif
83
83
  //! Convert user-supplied objects to Quantum
84
84
  #define APP2QUANTUM(n) rm_app2quantum((n))
@@ -457,7 +457,7 @@ EXTERN ID rm_ID_y; /**< "y" */
457
457
  Handle warnings & errors
458
458
  */
459
459
  //! Handle warnings & errors
460
- #define CHECK_EXCEPTION() rm_check_exception(&exception, NULL, RetainOnError);
460
+ #define CHECK_EXCEPTION() rm_check_exception(exception, NULL, RetainOnError);
461
461
 
462
462
 
463
463
  /*
@@ -634,9 +634,9 @@ Pixel_##_cmyk_channel_(VALUE self) \
634
634
  #define END_ENUM }
635
635
 
636
636
  //! Define a Magick module constant
637
- #if QuantumDepth == 64
637
+ #if MAGICKCORE_QUANTUM_DEPTH == 64
638
638
  #define DEF_CONST(constant) rb_define_const(Module_Magick, #constant, ULL2NUM(constant))
639
- #else // QuantumDepth == 8, 16, 32
639
+ #else // MAGICKCORE_QUANTUM_DEPTH == 8, 16, 32
640
640
  #define DEF_CONST(constant) rb_define_const(Module_Magick, #constant, UINT2NUM(constant))
641
641
  #endif
642
642
 
@@ -1075,6 +1075,8 @@ extern VALUE Image_read_inline(VALUE, VALUE);
1075
1075
  extern VALUE Image_recolor(VALUE, VALUE);
1076
1076
  extern VALUE Image_reduce_noise(VALUE, VALUE);
1077
1077
  extern VALUE Image_remap(int, VALUE *, VALUE);
1078
+ extern VALUE Image_resample(int, VALUE *, VALUE);
1079
+ extern VALUE Image_resample_bang(int, VALUE *, VALUE);
1078
1080
  extern VALUE Image_resize(int, VALUE *, VALUE);
1079
1081
  extern VALUE Image_resize_bang(int, VALUE *, VALUE);
1080
1082
  extern VALUE Image_roll(VALUE, VALUE, VALUE);
data/ext/RMagick/rmdraw.c CHANGED
@@ -501,16 +501,16 @@ image_to_str(Image *image)
501
501
  unsigned char *blob;
502
502
  size_t length;
503
503
  Info *info;
504
- ExceptionInfo exception;
504
+ ExceptionInfo *exception;
505
505
 
506
506
  if (image)
507
507
  {
508
508
  info = CloneImageInfo(NULL);
509
- GetExceptionInfo(&exception);
510
- blob = ImageToBlob(info, image, &length, &exception);
509
+ exception = AcquireExceptionInfo();
510
+ blob = ImageToBlob(info, image, &length, exception);
511
511
  DestroyImageInfo(info);
512
512
  CHECK_EXCEPTION();
513
- DestroyExceptionInfo(&exception);
513
+ DestroyExceptionInfo(exception);
514
514
  dimg = rb_str_new((char *)blob, (long)length);
515
515
  magick_free((void*)blob);
516
516
  }
@@ -536,16 +536,16 @@ Image *str_to_image(VALUE str)
536
536
  {
537
537
  Image *image = NULL;
538
538
  Info *info;
539
- ExceptionInfo exception;
539
+ ExceptionInfo *exception;
540
540
 
541
541
  if (str != Qnil)
542
542
  {
543
543
  info = CloneImageInfo(NULL);
544
- GetExceptionInfo(&exception);
545
- image = BlobToImage(info, RSTRING_PTR(str), RSTRING_LEN(str), &exception);
544
+ exception = AcquireExceptionInfo();
545
+ image = BlobToImage(info, RSTRING_PTR(str), RSTRING_LEN(str), exception);
546
546
  DestroyImageInfo(info);
547
547
  CHECK_EXCEPTION();
548
- DestroyExceptionInfo(&exception);
548
+ DestroyExceptionInfo(exception);
549
549
  }
550
550
 
551
551
  return image;
@@ -1776,15 +1776,15 @@ VALUE
1776
1776
  PolaroidOptions_initialize(VALUE self)
1777
1777
  {
1778
1778
  Draw *draw;
1779
- ExceptionInfo exception;
1779
+ ExceptionInfo *exception;
1780
1780
 
1781
1781
  // Default shadow color
1782
1782
  Data_Get_Struct(self, Draw, draw);
1783
1783
 
1784
- GetExceptionInfo(&exception);
1785
- (void) QueryColorDatabase("gray75", &draw->shadow_color, &exception);
1784
+ exception = AcquireExceptionInfo();
1785
+ (void) QueryColorDatabase("gray75", &draw->shadow_color, exception);
1786
1786
  CHECK_EXCEPTION()
1787
- (void) QueryColorDatabase("#dfdfdf", &draw->info->border_color, &exception);
1787
+ (void) QueryColorDatabase("#dfdfdf", &draw->info->border_color, exception);
1788
1788
 
1789
1789
  if (rb_block_given_p())
1790
1790
  {
data/ext/RMagick/rmenum.c CHANGED
@@ -408,8 +408,8 @@ ColorspaceType_new(ColorspaceType cs)
408
408
  case HSBColorspace:
409
409
  name = "HSBColorspace";
410
410
  break;
411
- case LABColorspace:
412
- name = "LABColorspace";
411
+ case LabColorspace:
412
+ name = "LabColorspace";
413
413
  break;
414
414
  case Rec601YCbCrColorspace:
415
415
  name = "Rec601YCbCrColorspace";