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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +18 -13
- data/TODO +2 -0
- data/lib/vips/version.rb +1 -1
- data/lib/vips/writer.rb +14 -12
- data/ruby-vips.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 089ea1c945c987de705749f712762e4ed5f74aa3
|
4
|
+
data.tar.gz: 6feeff8d78b3ca3e8e3ee63a65d9384787b327d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9c675ca4def94a475f0578e856dc130b56484688aa3b2751eda49e2a68050eb63f9442b07d69f4cf757905f7801e32fe21eaf130b5fd2117e96778427bcc8e8
|
7
|
+
data.tar.gz: 865652f25e10add687e72e2596e013bf56b114b7dae1966a9b388c71adbd9188fbbed8b31497c4d9ad5070dede456263b8d99a38718100f2464cbcdb20e12dd7
|
data/CHANGELOG.md
CHANGED
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
|
6
|
-
|
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
|
14
|
-
ruby-vips.rb
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
image_sci.rb
|
19
|
-
|
20
|
-
peak memory use in
|
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
|
23
|
-
|
24
|
-
|
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
data/lib/vips/version.rb
CHANGED
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
|
18
|
-
#
|
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 =
|
23
|
+
@@gc_interval = 100
|
22
24
|
@@gc_countdown = @@gc_interval
|
23
25
|
|
24
26
|
def write_gc(path)
|
25
|
-
@@
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
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.
|
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.
|
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-
|
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.
|
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-
|
12
|
+
date: 2016-01-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rdoc
|