rmagick 2.13.3 → 2.13.4

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 (54) hide show
  1. checksums.yaml +5 -13
  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/{README.rc → README.textile} +34 -104
  8. data/Rakefile +160 -24
  9. data/before_install_linux.sh +12 -0
  10. data/before_install_osx.sh +2 -0
  11. data/doc/.cvsignore +1 -0
  12. data/doc/ex/images/image_with_profile.jpg +0 -0
  13. data/doc/ex/mask.rb +1 -1
  14. data/examples/identify.rb +1 -1
  15. data/ext/RMagick/extconf.rb +60 -23
  16. data/ext/RMagick/rmagick.c +15 -15
  17. data/ext/RMagick/rmagick.h +9 -7
  18. data/ext/RMagick/rmdraw.c +12 -12
  19. data/ext/RMagick/rmenum.c +2 -2
  20. data/ext/RMagick/rmfill.c +25 -25
  21. data/ext/RMagick/rmilist.c +121 -104
  22. data/ext/RMagick/rmimage.c +737 -546
  23. data/ext/RMagick/rminfo.c +15 -15
  24. data/ext/RMagick/rmmain.c +27 -3
  25. data/ext/RMagick/rmpixel.c +25 -27
  26. data/ext/RMagick/rmstruct.c +1 -1
  27. data/ext/RMagick/rmutil.c +18 -18
  28. data/lib/RMagick.rb +1 -1962
  29. data/lib/rmagick.rb +1 -0
  30. data/lib/rmagick/version.rb +3 -1
  31. data/lib/rmagick_internal.rb +1964 -0
  32. data/rmagick.gemspec +14 -5
  33. data/test/Image2.rb +7 -3
  34. data/test/Image3.rb +54 -23
  35. data/test/ImageList2.rb +1 -1
  36. data/test/Image_attributes.rb +27 -10
  37. data/test/Import_Export.rb +11 -1
  38. data/test/Info.rb +4 -4
  39. data/test/Magick.rb +14 -54
  40. data/test/Pixel.rb +3 -4
  41. data/test/{all_basic.rb → test_all_basic.rb} +9 -17
  42. data/test/tmpnam_test.rb +50 -0
  43. metadata +50 -21
  44. data/README +0 -15
  45. data/README-Mac-OSX.txt +0 -1
  46. data/build_tarball.rake +0 -215
  47. data/lib/rvg/to_c.rb +0 -103
  48. data/metaconfig +0 -7
  49. data/pkg/rmagick-2.13.3.rc1.gem +0 -0
  50. data/post-clean.rb +0 -12
  51. data/post-install.rb +0 -50
  52. data/post-setup.rb +0 -254
  53. data/setup.rb +0 -1585
  54. data/uninstall.rb +0 -76
@@ -15,20 +15,19 @@ class Pixel_UT < Test::Unit::TestCase
15
15
  hash = nil
16
16
  assert_nothing_raised { hash = @pixel.hash}
17
17
  assert_not_nil(hash)
18
- assert_equal(-761981696, hash)
18
+ assert_equal(1385501952, hash)
19
19
 
20
20
  p = Magick::Pixel.new
21
21
  assert_equal(0, p.hash)
22
22
 
23
23
  p = Magick::Pixel.from_color('red')
24
- assert_equal(-8388608, p.hash)
24
+ assert_equal(2139095040, p.hash)
25
25
 
26
26
  # Pixel.hash sacrifices the last bit of the opacity channel
27
27
  p = Magick::Pixel.new(0, 0, 0, 72)
28
28
  p2 = Magick::Pixel.new(0, 0, 0, 73)
29
29
  assert_not_equal(p, p2)
30
30
  assert_equal(p.hash, p2.hash)
31
-
32
31
  end
33
32
 
34
33
  def test_eql?
@@ -66,7 +65,7 @@ class Pixel_UT < Test::Unit::TestCase
66
65
  25.times do |s|
67
66
  25.times do |l|
68
67
  5.times do |a|
69
- args = [20*h, s+25, l+25, a/5]
68
+ args = [20*h, s+25, l+25, a/5.0]
70
69
  px = Magick::Pixel.from_hsla(*args)
71
70
  hsla = px.to_hsla()
72
71
  #puts "[#{args.join(', ')}] = [#{hsla.join(', ')}]"
@@ -6,27 +6,20 @@ require 'test/unit/ui/console/testrunner' if !RUBY_VERSION[/^1\.9|^2/]
6
6
  puts RUBY_VERSION
7
7
  puts RUBY_VERSION.class
8
8
 
9
- module Test
10
- module Unit
11
- class TestCase
12
- alias :_old_run_ :run
13
- def run(result, &blk)
14
- method_name = RUBY_VERSION[/^1\.9|^2/] ? self.__name__ : @method_name
15
- puts "Running #{method_name}"
16
- _old_run_(result, &blk)
17
- end
18
- end
19
- end
20
- end
9
+ root_dir = File.expand_path("../..", __FILE__)
10
+ $LOAD_PATH.push(root_dir)
21
11
 
22
-
23
- $:.push('.')
24
-
25
- IMAGES_DIR = '../doc/ex/images'
12
+ IMAGES_DIR = File.join(root_dir, 'doc/ex/images')
26
13
  FILES = Dir[IMAGES_DIR+'/Button_*.gif'].sort
27
14
  FLOWER_HAT = IMAGES_DIR+'/Flower_Hat.jpg'
28
15
  IMAGE_WITH_PROFILE = IMAGES_DIR+'/image_with_profile.jpg'
29
16
 
17
+ Magick::Magick_version =~ /ImageMagick (\d+\.\d+\.\d+)-(\d+) /
18
+ abort "Unable to get ImageMagick version" unless $1 && $2
19
+
20
+ IM_VERSION = Gem::Version.new($1)
21
+ IM_REVISION = Gem::Version.new($2)
22
+
30
23
  require 'Image1.rb'
31
24
  require 'Image2.rb'
32
25
  require 'Image3.rb'
@@ -39,4 +32,3 @@ require 'Preview.rb'
39
32
  require 'Info.rb'
40
33
  require 'Magick.rb'
41
34
  require 'Draw.rb'
42
-
@@ -0,0 +1,50 @@
1
+ require 'minitest/autorun'
2
+ require 'rmagick'
3
+
4
+ class TmpnamTest < Minitest::Test
5
+ # test the @@_tmpnam_ class variable
6
+ # the count is incremented by Image::Info#texture=,
7
+ # ImageList::Montage#texture=, and Draw.composite
8
+ def test_tmpnam
9
+ tmpfiles = Dir[ENV["HOME"] + "/tmp/magick*"].length
10
+
11
+ texture = Magick::Image.read("granite:") { self.size = "20x20" }.first
12
+ info = Magick::Image::Info.new
13
+
14
+ # does not exist at first
15
+ assert_raise(NameError) { x = Magick._tmpnam_ }
16
+
17
+ info.texture = texture
18
+
19
+ # now it exists
20
+ assert_nothing_raised { x = Magick._tmpnam_ }
21
+ assert_equal(1, Magick._tmpnam_)
22
+
23
+ info.texture = texture
24
+ assert_equal(2, Magick._tmpnam_)
25
+
26
+ mon = Magick::ImageList::Montage.new
27
+ mon.texture = texture
28
+ assert_equal(3, Magick._tmpnam_)
29
+
30
+ mon.texture = texture
31
+ assert_equal(4, Magick._tmpnam_)
32
+
33
+ gc = Magick::Draw.new
34
+ gc.composite(0, 0, 20, 20, texture)
35
+ assert_equal(5, Magick._tmpnam_)
36
+
37
+ gc.composite(0, 0, 20, 20, texture)
38
+ assert_equal(6, Magick._tmpnam_)
39
+
40
+ tmpfiles2 = Dir[ENV["HOME"] + "/tmp/magick*"].length
41
+
42
+ # The 2nd montage texture deletes the first.
43
+ # The 2nd info texture deletes the first.
44
+ # Both composite images are still alive.
45
+ # Therefore only 4 tmp files are left.
46
+ #assert_equal(tmpfiles+4, tmpfiles2)
47
+ # 6.4.1-5 - only 1 tmpfile?
48
+ assert_equal(tmpfiles, tmpfiles2)
49
+ end
50
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rmagick
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.13.3
4
+ version: 2.13.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Hunter
@@ -11,8 +11,22 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-07-31 00:00:00.000000000 Z
15
- dependencies: []
14
+ date: 2014-11-25 00:00:00.000000000 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: rake-compiler
18
+ requirement: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :development
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
16
30
  description: RMagick is an interface between Ruby and ImageMagick.
17
31
  email: github@benjaminfleischer.com
18
32
  executables: []
@@ -20,14 +34,18 @@ extensions:
20
34
  - ext/RMagick/extconf.rb
21
35
  extra_rdoc_files: []
22
36
  files:
37
+ - ".gitignore"
38
+ - ".travis.yml"
39
+ - CONTRIBUTING.md
23
40
  - ChangeLog
24
41
  - Doxyfile
42
+ - Gemfile
25
43
  - LICENSE
26
- - README
27
- - README-Mac-OSX.txt
28
- - README.rc
44
+ - README.textile
29
45
  - Rakefile
30
- - build_tarball.rake
46
+ - before_install_linux.sh
47
+ - before_install_osx.sh
48
+ - doc/.cvsignore
31
49
  - doc/comtasks.html
32
50
  - doc/constants.html
33
51
  - doc/css/doc.css
@@ -188,6 +206,7 @@ files:
188
206
  - doc/ex/images/duck8.gif
189
207
  - doc/ex/images/duck9.gif
190
208
  - doc/ex/images/graydient230x6.gif
209
+ - doc/ex/images/image_with_profile.jpg
191
210
  - doc/ex/images/logo400x83.gif
192
211
  - doc/ex/images/model.miff
193
212
  - doc/ex/images/notimplemented.gif
@@ -356,7 +375,9 @@ files:
356
375
  - ext/RMagick/rmstruct.c
357
376
  - ext/RMagick/rmutil.c
358
377
  - lib/RMagick.rb
378
+ - lib/rmagick.rb
359
379
  - lib/rmagick/version.rb
380
+ - lib/rmagick_internal.rb
360
381
  - lib/rvg/clippath.rb
361
382
  - lib/rvg/container.rb
362
383
  - lib/rvg/deep_equal.rb
@@ -369,16 +390,9 @@ files:
369
390
  - lib/rvg/stretchable.rb
370
391
  - lib/rvg/stylable.rb
371
392
  - lib/rvg/text.rb
372
- - lib/rvg/to_c.rb
373
393
  - lib/rvg/transformable.rb
374
394
  - lib/rvg/units.rb
375
- - metaconfig
376
- - pkg/rmagick-2.13.3.rc1.gem
377
- - post-clean.rb
378
- - post-install.rb
379
- - post-setup.rb
380
395
  - rmagick.gemspec
381
- - setup.rb
382
396
  - test/Draw.rb
383
397
  - test/Image1.rb
384
398
  - test/Image2.rb
@@ -391,10 +405,10 @@ files:
391
405
  - test/Magick.rb
392
406
  - test/Pixel.rb
393
407
  - test/Preview.rb
394
- - test/all_basic.rb
395
408
  - test/cmyk.icm
396
409
  - test/srgb.icm
397
- - uninstall.rb
410
+ - test/test_all_basic.rb
411
+ - test/tmpnam_test.rb
398
412
  homepage: https://github.com/gemhome/rmagick
399
413
  licenses:
400
414
  - MIT
@@ -407,20 +421,35 @@ require_paths:
407
421
  - ext
408
422
  required_ruby_version: !ruby/object:Gem::Requirement
409
423
  requirements:
410
- - - ! '>='
424
+ - - ">="
411
425
  - !ruby/object:Gem::Version
412
426
  version: 1.8.5
413
427
  required_rubygems_version: !ruby/object:Gem::Requirement
414
428
  requirements:
415
- - - ! '>='
429
+ - - ">="
416
430
  - !ruby/object:Gem::Version
417
431
  version: '0'
418
432
  requirements:
419
433
  - ImageMagick 6.4.9 or later
420
434
  rubyforge_project: rmagick
421
- rubygems_version: 2.2.2
435
+ rubygems_version: 2.4.4
422
436
  signing_key:
423
437
  specification_version: 4
424
438
  summary: Ruby binding to ImageMagick
425
- test_files: []
426
- has_rdoc: false
439
+ test_files:
440
+ - test/Draw.rb
441
+ - test/Image1.rb
442
+ - test/Image2.rb
443
+ - test/Image3.rb
444
+ - test/ImageList1.rb
445
+ - test/ImageList2.rb
446
+ - test/Image_attributes.rb
447
+ - test/Import_Export.rb
448
+ - test/Info.rb
449
+ - test/Magick.rb
450
+ - test/Pixel.rb
451
+ - test/Preview.rb
452
+ - test/cmyk.icm
453
+ - test/srgb.icm
454
+ - test/test_all_basic.rb
455
+ - test/tmpnam_test.rb
data/README DELETED
@@ -1,15 +0,0 @@
1
- A new release 2.13.2 of RMagick is now available on github as well as rubygems.
2
-
3
- This release will fix the installation issues due to ruby 1.9.3 and ImageMagick 6.8+. You can install it the usual way with bundle by adding to Gemfile:
4
-
5
- gem 'rmagick', '2.13.2'
6
-
7
- or if you want to be on edge:
8
-
9
- gem 'rmagick', '2.13.2', :git=>'http://github.com/rmagick/rmagick.git'
10
-
11
- You also install it directly by doing:
12
-
13
- gem install rmagick
14
-
15
- - Moncef Maiza.
@@ -1 +0,0 @@
1
- For installation instructions see http://rmagick.rubyforge.org/install-osx.html
@@ -1,215 +0,0 @@
1
-
2
- # Build the tar.gz, tar.bz2, and .gem files for an RMagick Release
3
- # Expects the CVS tag for release RMagick x.y.z to be in the form RMagick_x-y-z.
4
- # To use: cd to $HOME
5
- # run: rake -f path/to/build_tarball.rake clean
6
- # rake -f path/to/build_tarball.rake release=tag beta=whatever
7
- #
8
- # Specify the release as release=RMagick_x-y-z or nothing if release=HEAD
9
- # Specify a beta Release as beta=beta1
10
-
11
- require 'rubygems'
12
- require 'redcloth'
13
- require 'find'
14
- require 'fileutils'
15
- include FileUtils
16
-
17
-
18
- CVSSERVER = ":ext:rmagick@rubyforge.org/var/cvs/rmagick"
19
-
20
-
21
- # CVS_Tag is the CVS tag for this release. Dist_Directory is CVS_Tag,
22
- # modified for use as a directory name.
23
- if ENV.include?("release")
24
- CVS_Tag = ENV["release"]
25
- Dist_Directory = CVS_Tag.tr('_-','-.')
26
- else
27
- CVS_Tag = "HEAD"
28
- Dist_Directory = "RMagick-0.0.0"
29
- end
30
-
31
-
32
- # RMagick_Version is just X.Y.Z
33
- RMagick_Version = Dist_Directory.sub(/RMagick-/, "")
34
-
35
- # RMagick_Version2 is X.Y.Z + "-beta1" if beta=beta1
36
- RMagick_Version2 = RMagick_Version + (ENV.include?("beta") ? "-" + ENV["beta"] : "")
37
-
38
- # Release is RMagick-X.Y.Z, plus "-beta1" if beta=beta1
39
- Release = Dist_Directory + (ENV.include?("beta") ? "-" + ENV["beta"] : "")
40
-
41
- README = "README.html"
42
- MANIFEST = "ext/RMagick/MANIFEST"
43
-
44
-
45
-
46
-
47
- # Change the version number placeholders in a file.
48
- # Returns an array of lines from the file.
49
- def reversion(name)
50
- now = Time.new
51
- now = now.strftime("%m/%d/%y")
52
-
53
- lines = File.readlines name
54
- lines.each do |line|
55
- line.gsub!(%r{0\.0\.0\$}, RMagick_Version2)
56
- line.gsub!(%r{0\.0\.0}, RMagick_Version)
57
- line.gsub!(%r{YY/MM/DD}, now)
58
- end
59
- lines
60
- end
61
-
62
-
63
-
64
-
65
- # Rewrite a file containing embedded version number placeholders.
66
- def reversion_file(name)
67
- lines = reversion(name)
68
- tmp_name = name + "_tmp"
69
- mv name, tmp_name
70
- begin
71
- File.open(name, "w") { |f| lines.each { |line| f.write line } }
72
- rescue
73
- mv tmp_name, name
74
- ensure
75
- rm tmp_name
76
- end
77
- end
78
-
79
-
80
-
81
-
82
- task :extconf do
83
- Dir.chdir(Dist_Directory) { reversion_file "ext/RMagick/extconf.rb" }
84
- end
85
-
86
-
87
-
88
-
89
- task :gemspec do
90
- Dir.chdir(Dist_Directory) { reversion_file "rmagick.gemspec" }
91
- end
92
-
93
-
94
-
95
-
96
- task "README.txt" do
97
- Dir.chdir Dist_Directory do
98
- reversion_file "README.rc"
99
- body = File.readlines "README.rc"
100
- body = RedCloth.new(body.join).to_html + "\n"
101
- File.open("README.txt", "w") { |f| f.write body }
102
- end
103
- end
104
-
105
-
106
-
107
-
108
- task README => "README.txt" do
109
- puts "writing #{README}"
110
- Dir.chdir Dist_Directory do
111
- File.open(README, "w") do |html|
112
- html.write <<END_HTML_HEAD
113
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
114
- <html>
115
- <head>
116
- <title>RMagick #{RMagick_Version2} README</title>
117
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
118
- <meta name="GENERATOR" content="RedCloth">
119
- </head>
120
- <body>
121
- END_HTML_HEAD
122
- html.write File.readlines("README.txt")
123
- html.write <<END_HTML_TAIL
124
- </body>
125
- </html>
126
- END_HTML_TAIL
127
- end
128
- end
129
- end
130
-
131
-
132
-
133
-
134
- task :doc do
135
- Dir.chdir(File.join(Dist_Directory, "doc")) do
136
- FileList["*.html"].each { |d| reversion_file(d) }
137
- end
138
- end
139
-
140
-
141
-
142
-
143
- # Remove files we don't want in the tarball.
144
- # Ensure files are not executable. (ref: bug #10080)
145
- task :fix_files do
146
- Dir.chdir Dist_Directory do
147
- rm_rf "test", :verbose => true
148
- rm "lib/rvg/to_c.rb", :verbose => true
149
- rm "README.rc", :verbose => true
150
- rm "README.txt", :verbose => true
151
- chmod 0644, FileList["doc/*.html", "doc/ex/*.rb", "doc/ex/images/*", "examples/*.rb"]
152
- end
153
- end
154
-
155
-
156
-
157
-
158
- task :manifest do
159
- now = Time.new
160
- now = now.strftime("%H:%M:%S %m/%d/%y")
161
- puts "generating #{MANIFEST}"
162
-
163
- Dir.chdir Dist_Directory do
164
- File.open(MANIFEST, "w") do |f|
165
- f.puts "MANIFEST for #{Release} - #{now}\n\n"
166
- Find.find('.') do |name|
167
- next if File.directory? name
168
- f.puts name[2..-1] # remove leading "./"
169
- end
170
- end
171
- end
172
- end
173
-
174
-
175
-
176
-
177
- task :export do
178
- sh "cvs -d#{CVSSERVER} export -r #{CVS_Tag} -d #{Dist_Directory} RMagick"
179
- end
180
-
181
-
182
-
183
-
184
- task :collateral => [README, :gemspec, :extconf, :doc]
185
-
186
- GEM = Dist_Directory.downcase + ".gem"
187
-
188
- task :default => [:export, :collateral, :fix_files, :manifest] do
189
- sh "tar czf #{Release}.tar.gz #{Dist_Directory}"
190
- sh "tar cjf #{Release}.tar.bz2 #{Dist_Directory}"
191
- sh "tar c #{Release} | 7z a -t7z -m0=lzma -mx=9 -mfb=64 -ms=on -si#{Release}.tar #{Release}.tar.lzma"
192
-
193
- # Extract with
194
- # 7z e RMagick-x.y.z.tar.lzma -so | tar xv
195
- #sh "tar cf #{Release}.tar #{Dist_Directory}"
196
- #sh "7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on #{Release}.tar.lzma #{Release}.tar"
197
- #rm_rf Release+".tar", :verbose => true
198
-
199
- Dir.chdir(Dist_Directory) do
200
- sh "gem build rmagick.gemspec"
201
- mv GEM, "../", :verbose => true
202
- end
203
- end
204
-
205
-
206
-
207
-
208
- task :clean do
209
- rm_rf Dist_Directory, :verbose => true
210
- rm_rf Release+".tar.gz", :verbose => true
211
- rm_rf Release+".tar.bz2", :verbose => true
212
- rm_rf Release+".tar.lzma", :verbose => true
213
- rm_rf GEM, :verbose => true
214
- end
215
-