rmagick 2.13.2 → 2.13.3.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rmagick might be problematic. Click here for more details.

Files changed (185) hide show
  1. checksums.yaml +15 -0
  2. data/LICENSE +20 -0
  3. data/README +15 -0
  4. data/README.rc +231 -0
  5. data/build_tarball.rake +1 -1
  6. data/doc/comtasks.html +2 -2
  7. data/doc/constants.html +2 -2
  8. data/doc/draw.html +2 -2
  9. data/doc/ex/PreserveAspectRatio.rb +0 -0
  10. data/doc/ex/ViewBox.rb +0 -0
  11. data/doc/ex/adaptive_threshold.rb +0 -0
  12. data/doc/ex/add_noise.rb +0 -0
  13. data/doc/ex/affine.rb +0 -0
  14. data/doc/ex/affine_transform.rb +0 -0
  15. data/doc/ex/arc.rb +0 -0
  16. data/doc/ex/arcpath.rb +0 -0
  17. data/doc/ex/average.rb +0 -0
  18. data/doc/ex/axes.rb +0 -0
  19. data/doc/ex/bilevel_channel.rb +0 -0
  20. data/doc/ex/blur_image.rb +0 -0
  21. data/doc/ex/border.rb +0 -0
  22. data/doc/ex/bounding_box.rb +0 -0
  23. data/doc/ex/cbezier1.rb +0 -0
  24. data/doc/ex/cbezier2.rb +0 -0
  25. data/doc/ex/cbezier3.rb +0 -0
  26. data/doc/ex/cbezier4.rb +0 -0
  27. data/doc/ex/cbezier5.rb +0 -0
  28. data/doc/ex/cbezier6.rb +0 -0
  29. data/doc/ex/channel.rb +0 -0
  30. data/doc/ex/charcoal.rb +0 -0
  31. data/doc/ex/chop.rb +0 -0
  32. data/doc/ex/circle.rb +0 -0
  33. data/doc/ex/clip_path.rb +0 -0
  34. data/doc/ex/coalesce.rb +0 -0
  35. data/doc/ex/color_fill_to_border.rb +0 -0
  36. data/doc/ex/color_floodfill.rb +0 -0
  37. data/doc/ex/color_histogram.rb +0 -0
  38. data/doc/ex/color_reset.rb +0 -0
  39. data/doc/ex/colorize.rb +0 -0
  40. data/doc/ex/colors.rb +0 -0
  41. data/doc/ex/composite.rb +0 -0
  42. data/doc/ex/composite_layers.rb +0 -0
  43. data/doc/ex/contrast.rb +0 -0
  44. data/doc/ex/crop.rb +0 -0
  45. data/doc/ex/cycle_colormap.rb +0 -0
  46. data/doc/ex/drawcomp.rb +0 -0
  47. data/doc/ex/drop_shadow.rb +0 -0
  48. data/doc/ex/edge.rb +0 -0
  49. data/doc/ex/ellipse.rb +0 -0
  50. data/doc/ex/emboss.rb +0 -0
  51. data/doc/ex/enhance.rb +0 -0
  52. data/doc/ex/equalize.rb +0 -0
  53. data/doc/ex/evenodd.rb +0 -0
  54. data/doc/ex/flatten_images.rb +0 -0
  55. data/doc/ex/flip.rb +0 -0
  56. data/doc/ex/flop.rb +0 -0
  57. data/doc/ex/fonts.rb +0 -0
  58. data/doc/ex/frame.rb +0 -0
  59. data/doc/ex/gaussian_blur.rb +0 -0
  60. data/doc/ex/get_pixels.rb +0 -0
  61. data/doc/ex/gradientfill.rb +0 -0
  62. data/doc/ex/grav.rb +0 -0
  63. data/doc/ex/gravity.rb +0 -0
  64. data/doc/ex/hatchfill.rb +0 -0
  65. data/doc/ex/images/logo400x83.gif +0 -0
  66. data/doc/ex/implode.rb +0 -0
  67. data/doc/ex/level.rb +0 -0
  68. data/doc/ex/line.rb +0 -0
  69. data/doc/ex/matte_fill_to_border.rb +0 -0
  70. data/doc/ex/matte_floodfill.rb +0 -0
  71. data/doc/ex/matte_replace.rb +0 -0
  72. data/doc/ex/median_filter.rb +0 -0
  73. data/doc/ex/modulate.rb +0 -0
  74. data/doc/ex/mono.rb +0 -0
  75. data/doc/ex/morph.rb +0 -0
  76. data/doc/ex/mosaic.rb +0 -0
  77. data/doc/ex/motion_blur.rb +0 -0
  78. data/doc/ex/negate.rb +0 -0
  79. data/doc/ex/nested_rvg.rb +0 -0
  80. data/doc/ex/nonzero.rb +0 -0
  81. data/doc/ex/normalize.rb +0 -0
  82. data/doc/ex/oil_paint.rb +0 -0
  83. data/doc/ex/opacity.rb +0 -0
  84. data/doc/ex/ordered_dither.rb +0 -0
  85. data/doc/ex/path.rb +0 -0
  86. data/doc/ex/pattern1.rb +0 -0
  87. data/doc/ex/pattern2.rb +0 -0
  88. data/doc/ex/polygon.rb +0 -0
  89. data/doc/ex/polyline.rb +0 -0
  90. data/doc/ex/preview.rb +0 -0
  91. data/doc/ex/qbezierpath.rb +0 -0
  92. data/doc/ex/quantize-m.rb +0 -0
  93. data/doc/ex/radial_blur.rb +0 -0
  94. data/doc/ex/raise.rb +0 -0
  95. data/doc/ex/rectangle.rb +0 -0
  96. data/doc/ex/reduce_noise.rb +0 -0
  97. data/doc/ex/roll.rb +0 -0
  98. data/doc/ex/rotate.rb +0 -0
  99. data/doc/ex/rotate_f.rb +0 -0
  100. data/doc/ex/roundrect.rb +0 -0
  101. data/doc/ex/rubyname.rb +0 -0
  102. data/doc/ex/rvg_linecap.rb +0 -0
  103. data/doc/ex/rvg_linejoin.rb +0 -0
  104. data/doc/ex/rvg_opacity.rb +0 -0
  105. data/doc/ex/rvg_stroke_dasharray.rb +0 -0
  106. data/doc/ex/segment.rb +0 -0
  107. data/doc/ex/shade.rb +0 -0
  108. data/doc/ex/shave.rb +0 -0
  109. data/doc/ex/shear.rb +0 -0
  110. data/doc/ex/sketch.rb +0 -0
  111. data/doc/ex/skewx.rb +0 -0
  112. data/doc/ex/skewy.rb +0 -0
  113. data/doc/ex/smile.rb +0 -0
  114. data/doc/ex/solarize.rb +0 -0
  115. data/doc/ex/spread.rb +0 -0
  116. data/doc/ex/stegano.rb +0 -0
  117. data/doc/ex/stroke_dasharray.rb +0 -0
  118. data/doc/ex/stroke_fill.rb +0 -0
  119. data/doc/ex/stroke_linecap.rb +0 -0
  120. data/doc/ex/stroke_linejoin.rb +0 -0
  121. data/doc/ex/stroke_width.rb +0 -0
  122. data/doc/ex/swirl.rb +0 -0
  123. data/doc/ex/text.rb +0 -0
  124. data/doc/ex/text_align.rb +0 -0
  125. data/doc/ex/text_antialias.rb +0 -0
  126. data/doc/ex/text_undercolor.rb +0 -0
  127. data/doc/ex/texture_fill_to_border.rb +0 -0
  128. data/doc/ex/texture_floodfill.rb +0 -0
  129. data/doc/ex/texturefill.rb +0 -0
  130. data/doc/ex/threshold.rb +0 -0
  131. data/doc/ex/to_blob.rb +0 -0
  132. data/doc/ex/translate.rb +0 -0
  133. data/doc/ex/transparent.rb +0 -0
  134. data/doc/ex/unsharp_mask.rb +0 -0
  135. data/doc/ex/wave.rb +0 -0
  136. data/doc/ilist.html +2 -2
  137. data/doc/image1.html +2 -2
  138. data/doc/image2.html +2 -2
  139. data/doc/image3.html +2 -2
  140. data/doc/imageattrs.html +2 -2
  141. data/doc/imusage.html +2 -2
  142. data/doc/index.html +3 -3
  143. data/doc/info.html +2 -2
  144. data/doc/magick.html +2 -2
  145. data/doc/optequiv.html +2 -2
  146. data/doc/rvg.html +2 -2
  147. data/doc/rvgclip.html +2 -2
  148. data/doc/rvggroup.html +2 -2
  149. data/doc/rvgimage.html +2 -2
  150. data/doc/rvgpattern.html +2 -2
  151. data/doc/rvgshape.html +2 -2
  152. data/doc/rvgstyle.html +2 -2
  153. data/doc/rvgtext.html +2 -2
  154. data/doc/rvgtspan.html +2 -2
  155. data/doc/rvgtut.html +2 -2
  156. data/doc/rvguse.html +2 -2
  157. data/doc/rvgxform.html +2 -2
  158. data/doc/struct.html +2 -2
  159. data/doc/usage.html +2 -2
  160. data/examples/crop_with_gravity.rb +0 -0
  161. data/examples/demo.rb +0 -0
  162. data/examples/describe.rb +0 -0
  163. data/examples/rotating_text.rb +0 -0
  164. data/ext/RMagick/extconf.rb +1 -9
  165. data/ext/RMagick/rmimage.c +1 -1
  166. data/lib/rvg/to_c.rb +103 -0
  167. data/rmagick.gemspec +5 -3
  168. data/test/Draw.rb +121 -0
  169. data/test/Image1.rb +763 -0
  170. data/test/Image2.rb +1308 -0
  171. data/test/Image3.rb +1002 -0
  172. data/test/ImageList1.rb +808 -0
  173. data/test/ImageList2.rb +389 -0
  174. data/test/Image_attributes.rb +683 -0
  175. data/test/Import_Export.rb +116 -0
  176. data/test/Info.rb +349 -0
  177. data/test/Magick.rb +364 -0
  178. data/test/Pixel.rb +120 -0
  179. data/test/Preview.rb +62 -0
  180. data/test/all_basic.rb +42 -0
  181. data/test/cmyk.icm +0 -0
  182. data/test/srgb.icm +0 -0
  183. metadata +339 -320
  184. data/README.html +0 -10
  185. data/ext/RMagick/MANIFEST +0 -358
@@ -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: Shapes</title>
9
+ <title>RMagick 0.0.0: RVG Reference: Shapes</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="rvgstyle.html">Prev</a> | <a href=
@@ -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: Styles</title>
9
+ <title>RMagick 0.0.0: RVG Reference: Styles</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="rvguse.html">Prev</a> | <a href=
@@ -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=
@@ -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=
@@ -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=
@@ -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=
@@ -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=
@@ -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=
@@ -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
File without changes
File without changes
File without changes
@@ -1,7 +1,7 @@
1
1
  require "mkmf"
2
2
  require "date"
3
3
 
4
- RMAGICK_VERS = "2.13.2"
4
+ RMAGICK_VERS = "0.0.0"
5
5
  MIN_RUBY_VERS = "1.8.5"
6
6
  MIN_RUBY_VERS_NO = MIN_RUBY_VERS.tr(".","").to_i
7
7
  MIN_IM_VERS = "6.4.9"
@@ -152,14 +152,6 @@ if RUBY_PLATFORM !~ /mswin|mingw/
152
152
 
153
153
  $magick_version = `Magick-config --version`.chomp
154
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"
162
- end
163
155
 
164
156
  # Save flags
165
157
  $CFLAGS = ENV["CFLAGS"].to_s + " " + `Magick-config --cflags`.chomp
@@ -9819,7 +9819,7 @@ Image_pixel_color(int argc, VALUE *argv, VALUE self)
9819
9819
  #else
9820
9820
  IndexPacket *indexes = GetIndexes(image);
9821
9821
  #endif
9822
- old_color = image->colormap[*indexes];
9822
+ old_color = image->colormap[(unsigned long)*indexes];
9823
9823
  }
9824
9824
  if (!image->matte)
9825
9825
  {
@@ -0,0 +1,103 @@
1
+ class Magick::RVG
2
+
3
+ private
4
+ def header_text(pgm, name)
5
+ pgm.puts <<"END_HEADER"
6
+ /*
7
+ Version: #{Magick_version}
8
+
9
+ gcc `Magick-config --cflags --cppflags` #{name}.c `Magick-config --ldflags --libs` -o #{name}
10
+ */
11
+
12
+ #include <stdio.h>
13
+ #include <time.h>
14
+ #include <sys/types.h>
15
+ #include <string.h>
16
+ #include <stdlib.h>
17
+ #include <magick/api.h>
18
+
19
+
20
+ int main(int argc,char **argv)
21
+ {
22
+ Image *image;
23
+ ImageInfo *info;
24
+ DrawInfo *draw;
25
+ const char * const primitives =
26
+ END_HEADER
27
+ end
28
+
29
+ def list_primitives(pgm, gc)
30
+ primitives = gc.inspect.split("\n")
31
+ indent = 0
32
+ primitives.each do |cmd|
33
+ indent -= 1 if cmd['pop ']
34
+ pgm.print(' ', (' '*indent), '"', cmd, '\n"', "\n")
35
+ indent += 1 if cmd['push ']
36
+ end
37
+ end
38
+
39
+ def trailer_text(pgm, name)
40
+ pgm.puts <<"END_TRAILER"
41
+ ;
42
+
43
+ InitializeMagick("#{name}");
44
+
45
+ info = CloneImageInfo(NULL);
46
+ if (!info)
47
+ {
48
+ MagickError(ResourceLimitError,"Unable to allocate ImageInfo",
49
+ "Memory allocation failed");
50
+ }
51
+
52
+ info->size = AcquireMagickMemory(20);
53
+ sprintf(info->size, "%dx%d", #{@width.to_i}, #{@height.to_i});
54
+
55
+ image = AllocateImage(info);
56
+ if (!image)
57
+ {
58
+ MagickError(ResourceLimitError,"Unable to allocate Image",
59
+ "Memory allocation failed");
60
+ }
61
+
62
+ SetImage(image, OpaqueOpacity);
63
+
64
+ draw = CloneDrawInfo(info, NULL);
65
+ CloneString(&(draw->primitive), primitives);
66
+ DrawImage(image, draw);
67
+
68
+ if (image->exception.severity != UndefinedException)
69
+ {
70
+ printf("%s: %s", image->exception.reason, image->exception.description);
71
+ exit(1);
72
+ }
73
+
74
+ strcpy(image->filename, "#{name+".gif"}");
75
+ WriteImage(info, image);
76
+
77
+ DestroyDrawInfo(draw);
78
+ DestroyImage(image);
79
+ DestroyImageInfo(info);
80
+ DestroyMagick();
81
+
82
+ return 0;
83
+ }
84
+ END_TRAILER
85
+ end
86
+
87
+ public
88
+
89
+ # Convert an RVG object to a stand-alone C program
90
+ # suitable for reproducing a bug.
91
+ def to_c(name)
92
+ pgm = File.open(name+".c", "w")
93
+ header_text(pgm, name)
94
+ gc = Draw.new
95
+ add_primitives(gc)
96
+ list_primitives(pgm, gc)
97
+ trailer_text(pgm, name)
98
+ pgm.close
99
+ $stderr.puts "Done"
100
+ end
101
+
102
+ end # class Magick::RVG
103
+
@@ -1,13 +1,15 @@
1
1
  require 'date'
2
2
  Gem::Specification.new do |s|
3
3
  s.name = %q{rmagick}
4
- s.version = "2.13.2"
4
+ s.version = "2.13.3.rc1"
5
5
  s.date = Date.today.to_s
6
6
  s.summary = %q{Ruby binding to ImageMagick}
7
7
  s.description = %q{RMagick is an interface between Ruby and ImageMagick.}
8
- s.authors = [%q{Tim Hunter}, %q{Omer Bar-or}, %q{Benjamin Thomas}]
8
+ s.authors = [%q{Tim Hunter}, %q{Omer Bar-or}, %q{Benjamin Thomas}, %q{Moncef Maiza}]
9
+ s.post_install_message = "Please report any bugs. This bugfix release may contain bugs. See https://github.com/rmagick/rmagick/compare/RMagick_2-13-2...master and https://github.com/rmagick/rmagick/issues/18"
9
10
  s.email = %q{rmagick@rubyforge.org}
10
- s.homepage = %q{http://rubyforge.org/projects/rmagick}
11
+ s.homepage = %q{https://github.com/rmagick/rmagick}
12
+ s.license = 'MIT'
11
13
  s.files = Dir.glob('**/*')
12
14
  s.bindir = 'bin'
13
15
  s.executables = Dir.glob('bin/*').collect {|f| File.basename(f)}
@@ -0,0 +1,121 @@
1
+
2
+ #! /usr/local/bin/ruby -w
3
+
4
+ require 'RMagick'
5
+ require 'test/unit'
6
+ require 'test/unit/ui/console/testrunner' if !RUBY_VERSION[/^1\.9|^2/]
7
+
8
+ class Magick::Draw
9
+ def self._dummy_img_
10
+ @@_dummy_img_
11
+ end
12
+ end
13
+
14
+ class Draw_UT < Test::Unit::TestCase
15
+
16
+ def setup
17
+ @draw = Magick::Draw.new
18
+ end
19
+
20
+ # Ensure @@_dummy_img_ class var is working properly
21
+ def test_dummy_img
22
+ # initially this variable is not defined.
23
+ assert_raise(NameError) do
24
+ Magick::Draw._dummy_img_
25
+ end
26
+
27
+ # cause it to become defined. save the object id.
28
+ @draw.get_type_metrics("ABCDEF")
29
+ dummy = nil
30
+ assert_nothing_raised do
31
+ dummy = Magick::Draw._dummy_img_
32
+ end
33
+
34
+ assert_instance_of(Magick::Image, dummy)
35
+
36
+ # ensure that it is always the same object
37
+ @draw.get_type_metrics("ABCDEF")
38
+ dummy2 = nil
39
+ assert_nothing_raised do
40
+ dummy2 = Magick::Draw._dummy_img_
41
+ end
42
+ assert_same(dummy, dummy2)
43
+ end
44
+
45
+ def test_kerning
46
+ assert_nothing_raised { @draw.kerning = 1 }
47
+ assert_nothing_raised { @draw.kerning(1) }
48
+ assert_raise(ArgumentError) { @draw.kerning("a") }
49
+ assert_raise(TypeError) { @draw.kerning([]) }
50
+ end
51
+
52
+ def test_interline_spacing
53
+ assert_nothing_raised { @draw.interline_spacing = 1 }
54
+ assert_nothing_raised { @draw.interline_spacing(1) }
55
+ assert_raise(ArgumentError) { @draw.interline_spacing("a") }
56
+ assert_raise(TypeError) { @draw.interline_spacing([]) }
57
+ end
58
+
59
+ def test_interword_spacing
60
+ assert_nothing_raised { @draw.interword_spacing = 1 }
61
+ assert_nothing_raised { @draw.interword_spacing(1) }
62
+ assert_raise(ArgumentError) { @draw.interword_spacing("a") }
63
+ assert_raise(TypeError) { @draw.interword_spacing([]) }
64
+ end
65
+
66
+ def assert_marshal
67
+ rose = Magick::Image.read("rose:").first
68
+ granite = Magick::Image.read("granite:").first
69
+ s = granite.to_blob {self.format="miff"}
70
+ granite = Magick::Image.from_blob(s).first
71
+ blue_stroke = Magick::Image.new(20,20) {self.background_color = "blue"}
72
+ s = blue_stroke.to_blob {self.format="miff"}
73
+ blue_stroke = Magick::Image.from_blob(s).first
74
+
75
+ @draw.affine = Magick::AffineMatrix.new(1, 2, 3, 4, 5, 6)
76
+ @draw.decorate = Magick::LineThroughDecoration
77
+ @draw.encoding = "AdobeCustom"
78
+ @draw.gravity = Magick::CenterGravity
79
+ @draw.fill = Magick::Pixel.from_color("red")
80
+ @draw.stroke = Magick::Pixel.from_color("blue")
81
+ @draw.stroke_width = 5
82
+ @draw.fill_pattern = granite
83
+ @draw.stroke_pattern = blue_stroke
84
+ @draw.text_antialias = true
85
+ @draw.font = "Arial-Bold"
86
+ @draw.font_family = "arial"
87
+ @draw.font_style = Magick::ItalicStyle
88
+ @draw.font_stretch = Magick::CondensedStretch
89
+ @draw.font_weight = Magick::BoldWeight
90
+ @draw.pointsize = 12
91
+ @draw.density = "72x72"
92
+ @draw.align = Magick::CenterAlign
93
+ @draw.undercolor = Magick::Pixel.from_color("green")
94
+ @draw.kerning = 10.5
95
+ @draw.interword_spacing = 3.75
96
+
97
+ @draw.circle(20, 25, 20, 28)
98
+ dumped = nil
99
+ assert_nothing_raised { dumped = Marshal.dump(@draw) }
100
+ assert_nothing_raised { Marshal.load(dumped) }
101
+ end
102
+
103
+ def test_patterns
104
+ img = Magick::Image.new(20,20)
105
+ assert_nothing_raised { @draw.fill_pattern = img }
106
+ assert_nothing_raised { @draw.stroke_pattern = img }
107
+
108
+ ilist = Magick::ImageList.new
109
+ ilist << img
110
+ assert_nothing_raised { @draw.fill_pattern = ilist }
111
+ assert_nothing_raised { @draw.stroke_pattern = ilist }
112
+
113
+ assert_raise(NoMethodError) { @draw.fill_pattern = 1 }
114
+ assert_raise(NoMethodError) { @draw.stroke_pattern = 1 }
115
+ end
116
+ end
117
+
118
+ if __FILE__ == $0
119
+ Test::Unit::UI::Console::TestRunner.run(Draw_UT) if !RUBY_VERSION[/^1\.9|^2/]
120
+ end
121
+