ruby-vips 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +11 -11
- data/VERSION +1 -1
- data/lib/vips/image.rb +20 -0
- data/lib/vips/version.rb +1 -1
- 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: e080fa314558d90863e7390d94086790422d4a40
|
4
|
+
data.tar.gz: 98f69bed55a1da2ac83593a68ec10cb7c582a0a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46c212d684b0976f2c96ebd31b6d5568965b1accb99d8c2d26794b5d674755b87684cbd71a0222bc9d3810008f3f2c56f8613927c2e3f870113c62cec692b7f1
|
7
|
+
data.tar.gz: 84eb1bbb0194291e6f231420c9d2047f0c03bf91d2918a9028020476c665b7928b1b0e3f982b2d469c10bedc9728e72117ccdcbeb8611f6ad8d8d2d327986255
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -18,16 +18,16 @@ keep entire images in memory, it's light. For example, the benchmark at
|
|
18
18
|
large image, crops, shrinks, sharpens and saves again, and repeats 10 times.
|
19
19
|
|
20
20
|
```text
|
21
|
-
real time in seconds, fastest of
|
21
|
+
real time in seconds, fastest of five runs
|
22
22
|
benchmark tiff jpeg
|
23
|
-
ruby-vips.rb
|
24
|
-
image-magick
|
25
|
-
rmagick.rb
|
26
|
-
|
27
|
-
peak memory use in
|
28
|
-
benchmark
|
29
|
-
ruby-vips.rb
|
30
|
-
rmagick.rb
|
23
|
+
ruby-vips.rb 0.85 0.78
|
24
|
+
image-magick 2.03 2.44
|
25
|
+
rmagick.rb 3.87 3.89
|
26
|
+
|
27
|
+
peak memory use in kb
|
28
|
+
benchmark peak RES
|
29
|
+
ruby-vips.rb 43864
|
30
|
+
rmagick.rb 788768
|
31
31
|
```
|
32
32
|
|
33
33
|
See also [benchmarks at the official libvips
|
@@ -63,8 +63,8 @@ gem 'ruby-vips'
|
|
63
63
|
On Windows, you'll need to set the `RUBY_DLL_PATH` environment variable to
|
64
64
|
point to the libvips bin directory.
|
65
65
|
|
66
|
-
Take a look in `examples/`. There is full
|
67
|
-
|
66
|
+
Take a look in `examples/`. There is [full API
|
67
|
+
documentation](http://www.rubydoc.info/gems/ruby-vips).
|
68
68
|
|
69
69
|
# Example
|
70
70
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.3
|
data/lib/vips/image.rb
CHANGED
@@ -29,6 +29,7 @@ module Vips
|
|
29
29
|
attach_function :vips_image_get_typeof, [:pointer, :string], :GType
|
30
30
|
attach_function :vips_image_get,
|
31
31
|
[:pointer, :string, GObject::GValue.ptr], :int
|
32
|
+
attach_function :vips_image_get_fields, [:pointer], :pointer
|
32
33
|
attach_function :vips_image_set,
|
33
34
|
[:pointer, :string, GObject::GValue.ptr], :void
|
34
35
|
attach_function :vips_image_remove, [:pointer, :string], :void
|
@@ -492,6 +493,25 @@ module Vips
|
|
492
493
|
return gvalue.get
|
493
494
|
end
|
494
495
|
|
496
|
+
# Get the names of all fields on an image. Use this to loop over all
|
497
|
+
# image metadata.
|
498
|
+
#
|
499
|
+
# @return [[String]] array of field names
|
500
|
+
def get_fields
|
501
|
+
array = Vips::vips_image_get_fields self
|
502
|
+
|
503
|
+
names = []
|
504
|
+
p = array
|
505
|
+
until ((q = p.read_pointer).null?)
|
506
|
+
names << q.read_string
|
507
|
+
GLib::g_free q
|
508
|
+
p += FFI::Type::POINTER.size
|
509
|
+
end
|
510
|
+
GLib::g_free array
|
511
|
+
|
512
|
+
return names
|
513
|
+
end
|
514
|
+
|
495
515
|
# Create a metadata item on an image, of the specifed type. Ruby types
|
496
516
|
# are automatically
|
497
517
|
# transformed into the matching `GType`, if possible.
|
data/lib/vips/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-vips
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Cupitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|