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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc07fdb1e2def0cb74571c3662c1a7cc568505c8
4
- data.tar.gz: 2302be93ac930c25b90eacade712c8fbe685abeb
3
+ metadata.gz: e080fa314558d90863e7390d94086790422d4a40
4
+ data.tar.gz: 98f69bed55a1da2ac83593a68ec10cb7c582a0a6
5
5
  SHA512:
6
- metadata.gz: 59b7246675bb70923a0df56fe3ea1a2f5d9de71040377c74851d911e982555961bd3fc280f290f5714666479726e766b8c63c30a58b0c3146280ffe972ef266b
7
- data.tar.gz: f325a99c620ca792ff0380292312020edbfc7faf5e6f7ee6436646fc6fe89d2acf7e2fbd3ef7c624bcc08c0ed6d6ada149d894ba2a15662fb02e8ef08197a45a
6
+ metadata.gz: 46c212d684b0976f2c96ebd31b6d5568965b1accb99d8c2d26794b5d674755b87684cbd71a0222bc9d3810008f3f2c56f8613927c2e3f870113c62cec692b7f1
7
+ data.tar.gz: 84eb1bbb0194291e6f231420c9d2047f0c03bf91d2918a9028020476c665b7928b1b0e3f982b2d469c10bedc9728e72117ccdcbeb8611f6ad8d8d2d327986255
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## Version 2.0.3 (2017-09-02)
6
+
7
+ * add `get_fields`
8
+
5
9
  ## Version 2.0.2 (2017-08-26)
6
10
 
7
11
  * switch to `logger` for all logging output
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 three runs
21
+ real time in seconds, fastest of five runs
22
22
  benchmark tiff jpeg
23
- ruby-vips.rb 0.66 0.44
24
- image-magick 1.10 1.50
25
- rmagick.rb 1.63 2.16
26
-
27
- peak memory use in bytes
28
- benchmark peak RSS
29
- ruby-vips.rb 58696
30
- rmagick.rb 787564
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 yard documentation, take a look
67
- there too.
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.2
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
@@ -1,4 +1,4 @@
1
1
  module Vips
2
- VERSION = "2.0.2"
2
+ VERSION = "2.0.3"
3
3
  end
4
4
 
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.2
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-08-29 00:00:00.000000000 Z
11
+ date: 2017-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi