ruby-vips 0.3.3 → 0.3.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.
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +9 -9
- data/README.md +4 -19
- data/ext/reader.c +6 -0
- data/lib/vips/reader.rb +10 -2
- data/lib/vips/version.rb +1 -1
- data/ruby-vips.gemspec +2 -2
- metadata +4 -4
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# master
|
|
2
2
|
|
|
3
|
+
# Version 0.3.4
|
|
4
|
+
|
|
5
|
+
* Update specs for lcms changes, thanks Stanislaw [John Cupitt]
|
|
6
|
+
* VIPS::Reader supports .exif() / .exif?() methods for better back compat, thanks Jeremy [John Cupitt]
|
|
7
|
+
* VIPS::Reader fallbacks load the image if its not been loaded [John Cupitt]
|
|
8
|
+
* VIPS::Reader no longer allows VIPS::Header methods [John Cupitt]
|
|
9
|
+
|
|
3
10
|
# Version 0.3.3
|
|
4
11
|
|
|
5
12
|
* Typo in workaround in 0.3.2 [John Cupitt]
|
data/Gemfile.lock
CHANGED
|
@@ -3,23 +3,23 @@ GEM
|
|
|
3
3
|
specs:
|
|
4
4
|
diff-lcs (1.1.3)
|
|
5
5
|
git (1.2.5)
|
|
6
|
-
jeweler (1.8.
|
|
6
|
+
jeweler (1.8.4)
|
|
7
7
|
bundler (~> 1.0)
|
|
8
8
|
git (>= 1.2.5)
|
|
9
9
|
rake
|
|
10
10
|
rdoc
|
|
11
|
-
json (1.7.
|
|
11
|
+
json (1.7.5)
|
|
12
12
|
rake (0.9.2.2)
|
|
13
13
|
rdoc (3.12)
|
|
14
14
|
json (~> 1.4)
|
|
15
|
-
rspec (2.
|
|
16
|
-
rspec-core (~> 2.
|
|
17
|
-
rspec-expectations (~> 2.
|
|
18
|
-
rspec-mocks (~> 2.
|
|
19
|
-
rspec-core (2.
|
|
20
|
-
rspec-expectations (2.
|
|
15
|
+
rspec (2.11.0)
|
|
16
|
+
rspec-core (~> 2.11.0)
|
|
17
|
+
rspec-expectations (~> 2.11.0)
|
|
18
|
+
rspec-mocks (~> 2.11.0)
|
|
19
|
+
rspec-core (2.11.1)
|
|
20
|
+
rspec-expectations (2.11.3)
|
|
21
21
|
diff-lcs (~> 1.1.3)
|
|
22
|
-
rspec-mocks (2.
|
|
22
|
+
rspec-mocks (2.11.2)
|
|
23
23
|
|
|
24
24
|
PLATFORMS
|
|
25
25
|
ruby
|
data/README.md
CHANGED
|
@@ -90,10 +90,6 @@ Alternatively, for a debug build:
|
|
|
90
90
|
$ gem install ruby-vips -- --enable-debug
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
```bash
|
|
94
|
-
$ gem install ruby-vips
|
|
95
|
-
```
|
|
96
|
-
|
|
97
93
|
or include it in Gemfile:
|
|
98
94
|
|
|
99
95
|
```ruby
|
|
@@ -147,6 +143,10 @@ im_shrink_by_two.png('out.png', :interlace => true)
|
|
|
147
143
|
# be written as:
|
|
148
144
|
Image.jpeg('mypic.jpg', :shrink_factor => 4).shrink(2).png('out.png')
|
|
149
145
|
|
|
146
|
+
# You hint sequential mode in the loader, so this will stream directly from
|
|
147
|
+
# the source image:
|
|
148
|
+
Image.jpeg('large.png', :sequential => true).shrink(2).png('out.png')
|
|
149
|
+
|
|
150
150
|
# The statement above will load the jpeg (pre-shrunk by a factor of four),
|
|
151
151
|
# shrink the image again by a factor of two, and then save as a png image.
|
|
152
152
|
|
|
@@ -155,21 +155,6 @@ Image.jpeg('mypic.jpg', :shrink_factor => 4).shrink(2).png('out.png')
|
|
|
155
155
|
Image.new('mypic.jpg').shrink(2).write('out.png')
|
|
156
156
|
```
|
|
157
157
|
|
|
158
|
-
## Garbage collection
|
|
159
|
-
|
|
160
|
-
ruby-vips only frees images on GC. In other words:
|
|
161
|
-
|
|
162
|
-
```ruby
|
|
163
|
-
a = Image.new(filename)
|
|
164
|
-
a = nil
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
will not release the resources associated with `a`, you have to
|
|
168
|
-
either request a GC explicitly or wait for Ruby to GC for you. This can
|
|
169
|
-
be a problem if you're processing many images.
|
|
170
|
-
|
|
171
|
-
We suggest you schedule a GC every 100 images processed.
|
|
172
|
-
|
|
173
158
|
## Why use ruby-vips?
|
|
174
159
|
|
|
175
160
|
- It supports over 250 low-level image and color manipulation operations.
|
data/ext/reader.c
CHANGED
|
@@ -86,7 +86,13 @@ init_Reader(void)
|
|
|
86
86
|
id_iv__vips_fmt = rb_intern("@_vips_fmt");
|
|
87
87
|
|
|
88
88
|
VALUE reader = rb_define_class_under(mVIPS, "Reader", rb_cObject);
|
|
89
|
+
|
|
90
|
+
/* We used to allow header methods on VIPS::Reader, we don't any more
|
|
91
|
+
*
|
|
92
|
+
* lib/vips/reader.rb includes a few header methods for back compat
|
|
93
|
+
*
|
|
89
94
|
rb_include_module(reader, mVIPSHeader);
|
|
95
|
+
*/
|
|
90
96
|
rb_define_alloc_func(reader, img_alloc);
|
|
91
97
|
|
|
92
98
|
rb_define_singleton_method(reader, "recognized?", reader_s_recognized_p, 1);
|
data/lib/vips/reader.rb
CHANGED
|
@@ -17,11 +17,19 @@ module VIPS
|
|
|
17
17
|
|
|
18
18
|
# support these two for compat with older ruby-vips
|
|
19
19
|
def x_size
|
|
20
|
-
|
|
20
|
+
read.x_size
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def y_size
|
|
24
|
-
|
|
24
|
+
read.y_size
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def exif
|
|
28
|
+
read.exif
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def exif?
|
|
32
|
+
read.exif?
|
|
25
33
|
end
|
|
26
34
|
|
|
27
35
|
private
|
data/lib/vips/version.rb
CHANGED
data/ruby-vips.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = "ruby-vips"
|
|
8
|
-
s.version = "0.3.
|
|
8
|
+
s.version = "0.3.4"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Timothy Elliott", "John Cupitt"]
|
|
12
|
-
s.date = "2012-
|
|
12
|
+
s.date = "2012-09-11"
|
|
13
13
|
s.description = "Ruby extension for the vips image processing library."
|
|
14
14
|
s.email = "jcupitt@gmail.com"
|
|
15
15
|
s.extensions = ["ext/extconf.rb"]
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby-vips
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 27
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 3
|
|
9
|
-
-
|
|
10
|
-
version: 0.3.
|
|
9
|
+
- 4
|
|
10
|
+
version: 0.3.4
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Timothy Elliott
|
|
@@ -16,7 +16,7 @@ autorequire:
|
|
|
16
16
|
bindir: bin
|
|
17
17
|
cert_chain: []
|
|
18
18
|
|
|
19
|
-
date: 2012-
|
|
19
|
+
date: 2012-09-11 00:00:00 Z
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|
|
22
22
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|