ruby-vips 0.3.13 → 0.3.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4af218bf97030516ebd6863f9010ae5778fc24c
4
- data.tar.gz: 04dd15fc41d79e27220906fd024e7504470cb42f
3
+ metadata.gz: 089ea1c945c987de705749f712762e4ed5f74aa3
4
+ data.tar.gz: 6feeff8d78b3ca3e8e3ee63a65d9384787b327d0
5
5
  SHA512:
6
- metadata.gz: e0df366592bbd14982d4a95afaa44c632827d25639c89f142886e8db1dadd17c4b6663ff2b60e1261820244317eed86be5c093e6d30b3accf3b55d5c7cb64c21
7
- data.tar.gz: 5294e0acd1be165466767ac5bb4251bb4b15f8b912a3ac5c7144ad56d82497e67dc59f414b48e1be6b827e62950582500197754aebfcbc048ddc3f2e8a79be3d
6
+ metadata.gz: d9c675ca4def94a475f0578e856dc130b56484688aa3b2751eda49e2a68050eb63f9442b07d69f4cf757905f7801e32fe21eaf130b5fd2117e96778427bcc8e8
7
+ data.tar.gz: 865652f25e10add687e72e2596e013bf56b114b7dae1966a9b388c71adbd9188fbbed8b31497c4d9ad5070dede456263b8d99a38718100f2464cbcdb20e12dd7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # master
2
2
 
3
+ # Version 0.3.14
4
+
5
+ * more GC tuning [felixbuenemann]
6
+ * add `write.rb` example program [felixbuenemann]
7
+
3
8
  # Version 0.3.13
4
9
 
5
10
  * don't use generational GC options on old Rubys [John Cupitt]
data/README.md CHANGED
@@ -2,26 +2,31 @@
2
2
 
3
3
  [![Build Status](https://secure.travis-ci.org/jcupitt/ruby-vips.png)](http://travis-ci.org/jcupitt/ruby-vips)
4
4
 
5
- ruby-vips is a ruby extension for [vips](http://www.vips.ecs.soton.ac.uk).
6
- It is fast and it can work without needing the
5
+ This is `ruby-vips`, a gem for the
6
+ [libvips](http://www.vips.ecs.soton.ac.uk) image processing library.
7
+ This gem is still being maintained, but for new projects you should look at
8
+ the newer [ruby-vips8](https://rubygems.org/gems/ruby-vips8) gem.
9
+
10
+ ruby-vips is fast and it can work without needing the
7
11
  entire image to be loaded into memory. For example, the benchmark at
8
12
  [vips-benchmarks](https://github.com/stanislaw/vips-benchmarks) loads a large
9
13
  image, crops, shrinks, sharpens and saves again:
10
14
 
11
15
  ```text
12
16
  real time in seconds, fastest of three runs
13
- benchmark tiff jpeg
14
- ruby-vips.rb 0.45 0.56
15
- rmagick.rb 1.69 1.90
16
- netpbm.sh 1.74 1.63
17
- image-magick.sh 2.87 3.02
18
- image_sci.rb 3.19 2.90
19
-
20
- peak memory use in kilobytes
17
+ benchmark tiff jpeg
18
+ ruby-vips.rb 2.77 2.98
19
+ ruby-vips8.rb 2.97 3.29
20
+ image-magick 8.18 9.71
21
+ rmagick.rb 9.22 10.06
22
+ image_sci.rb 9.39 7.20
23
+
24
+ peak memory use in bytes
21
25
  benchmark peak RSS
22
- ruby-vips.rb 160400
23
- image_sci.rb 546992
24
- rmagick.rb 1370064
26
+ ruby-vips.rb 107340
27
+ ruby-vips8.rb 117604
28
+ image_sci.rb 146536
29
+ rmagick.rb 3352020
25
30
  ```
26
31
 
27
32
  See also [benchmarks at the official libvips
data/TODO CHANGED
@@ -1,6 +1,8 @@
1
1
  - add something to make a memory image, useful in some cases, eg. making very
2
2
  large image mosaics
3
3
 
4
+ - support vips_resize()
5
+
4
6
  - support vips_flatten(), see
5
7
 
6
8
  https://github.com/jcupitt/ruby-vips/issues/45
data/lib/vips/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module VIPS
2
- VERSION = "0.3.13"
2
+ VERSION = "0.3.14"
3
3
  end
data/lib/vips/writer.rb CHANGED
@@ -6,29 +6,31 @@ module VIPS
6
6
 
7
7
  private
8
8
 
9
- # write can fail due to no file descriptors
9
+ # write can fail due to no file descriptors, memory can fill if large
10
+ # objects are not collected fairly soon
10
11
  #
11
12
  # we can't try a write and GC and retry on fail, since the write may take a
12
13
  # long time
13
14
  #
14
15
  # GCing before every write would have a horrible effect on performance, so
15
16
  # as a compromise we GC every @@gc_interval writes
16
-
17
- # ruby2.1 introduced a generational GC which can do a low-impact GC ... we
18
- # behave differently for this
17
+ #
18
+ # ruby2.1 introduced a generational GC which
19
+ # is fast enough to be able to GC on every write
20
+
19
21
  @@generational_gc = RUBY_ENGINE == "ruby" && RUBY_VERSION.to_f >= 2.1
20
22
 
21
- @@gc_interval = if @@generational_gc then 10 else 100 end
23
+ @@gc_interval = 100
22
24
  @@gc_countdown = @@gc_interval
23
25
 
24
26
  def write_gc(path)
25
- @@gc_countdown -= 1
26
- if @@gc_countdown < 0
27
- @@gc_countdown = @@gc_interval
28
- if @@generational_gc
29
- GC.start full_mark: false, immediate_sweep: false
30
- else
31
- GC.start
27
+ if @@generational_gc
28
+ GC.start full_mark: false
29
+ else
30
+ @@gc_countdown -= 1
31
+ if @@gc_countdown < 0
32
+ @@gc_countdown = @@gc_interval
33
+ GC.start
32
34
  end
33
35
  end
34
36
 
data/ruby-vips.gemspec CHANGED
@@ -2,17 +2,17 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: ruby-vips 0.3.13 ruby lib
5
+ # stub: ruby-vips 0.3.14 ruby lib
6
6
  # stub: ext/extconf.rb
7
7
 
8
8
  Gem::Specification.new do |s|
9
9
  s.name = "ruby-vips"
10
- s.version = "0.3.13"
10
+ s.version = "0.3.14"
11
11
 
12
12
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
13
13
  s.require_paths = ["lib"]
14
14
  s.authors = ["Timothy Elliott", "John Cupitt"]
15
- s.date = "2016-01-18"
15
+ s.date = "2016-01-25"
16
16
  s.description = "Ruby extension for the vips image processing library."
17
17
  s.email = "jcupitt@gmail.com"
18
18
  s.extensions = ["ext/extconf.rb"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-vips
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.13
4
+ version: 0.3.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timothy Elliott
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-18 00:00:00.000000000 Z
12
+ date: 2016-01-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdoc