ruby-vips 2.0.9 → 2.0.10

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: 73d6ac365e6bbd2f6202a9f6a48c56cc905dacd0
4
- data.tar.gz: 2091c1567fef3313462ffa40e6498061abf07655
3
+ metadata.gz: 07d28520a0b6b7e8fee09e6392b0e1904f6391e1
4
+ data.tar.gz: d7302466fa01d9713edae0594cecac2f70c43807
5
5
  SHA512:
6
- metadata.gz: 47bf833edf1d9c98ed6acfeb22e315515e9e15110df45155d576eba096f2c8fdca479d99b57013b6a5eb83180b011bcff8b594624c2094265bb31af23ea14c1e
7
- data.tar.gz: fd4c920dde19ffdd3b21aa8c7c6a689c74a911921268543423cfe35deb31b9ac4d972c425e66ae2bf0dbbfe40279ec82b97c98e292318af6df60ac12068efb2f
6
+ metadata.gz: 128911db0a865b714554b4540d113d9276fa077aa9f08a1fc69f8d6c227a11c7379665eb24d6996acd0af2b268829603fc28232d71aca97bb943a4a293bf0851
7
+ data.tar.gz: 240dba73bfca4a96ea82046ee83dc5db413b00d1b8ff19bd2d2228e94ac29a6d4bca09fab4bd9b45522066ffed63c0aed8fb25583dee0deeca5839ceec78af23
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## Version 2.0.10 (2017-12-21)
6
+
7
+ * add support for uint64 parameters
8
+ * add `draw_point` convenience method
9
+ * add docs for `CompassDirection` [janko-m]
10
+ * add `MAX_COORD` constant
11
+ * doc fixes [janko-m]
12
+ * remove duplicate function attach [janko-m]
13
+ * fix a crash with `new_from_buffer` with a UTF-8 string [janko-m]
14
+
5
15
  ## Version 2.0.9 (2017-12-21)
6
16
 
7
17
  * update docs for libvips 8.6
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.9
1
+ 2.0.10
@@ -141,6 +141,7 @@ module GObject
141
141
  # look up some common gtypes
142
142
  GBOOL_TYPE = g_type_from_name "gboolean"
143
143
  GINT_TYPE = g_type_from_name "gint"
144
+ GUINT64_TYPE = g_type_from_name "guint64"
144
145
  GDOUBLE_TYPE = g_type_from_name "gdouble"
145
146
  GENUM_TYPE = g_type_from_name "GEnum"
146
147
  GFLAGS_TYPE = g_type_from_name "GFlags"
@@ -577,6 +578,10 @@ module Vips
577
578
 
578
579
  LIBRARY_VERSION = Vips::version_string
579
580
 
581
+ # libvips has this arbitrary number as a sanity-check upper bound on image
582
+ # size. It's sometimes useful for know whan calculating image ratios.
583
+ MAX_COORD = 10000000
584
+
580
585
  end
581
586
 
582
587
  require 'vips/object'
@@ -0,0 +1,17 @@
1
+ module Vips
2
+
3
+ # A direction on a compass used for placing images. See {Image#gravity}.
4
+ #
5
+ # * `:centre`
6
+ # * `:north`
7
+ # * `:east`
8
+ # * `:south`
9
+ # * `:west`
10
+ # * `:north-east`
11
+ # * `"south-east`
12
+ # * `:south-west`
13
+ # * `:north-west`
14
+
15
+ class CompassDirection < Symbol
16
+ end
17
+ end
@@ -96,6 +96,9 @@ module GObject
96
96
  when GINT_TYPE
97
97
  ::GObject::g_value_set_int self, value
98
98
 
99
+ when GUINT64_TYPE
100
+ ::GObject::g_value_set_uint64 self, value
101
+
99
102
  when GDOUBLE_TYPE
100
103
  ::GObject::g_value_set_double self, value
101
104
 
@@ -134,7 +137,7 @@ module GObject
134
137
  value.each {|image| ::GObject::g_object_ref image}
135
138
 
136
139
  when Vips::BLOB_TYPE
137
- len = value.length
140
+ len = value.bytesize
138
141
  ptr = GLib::g_malloc len
139
142
  Vips::vips_value_set_blob self, GLib::G_FREE, ptr, len
140
143
  ptr.write_bytes value
@@ -175,6 +178,9 @@ module GObject
175
178
  when GINT_TYPE
176
179
  result = ::GObject::g_value_get_int self
177
180
 
181
+ when GUINT64_TYPE
182
+ result = ::GObject::g_value_get_uint64 self
183
+
178
184
  when GDOUBLE_TYPE
179
185
  result = ::GObject::g_value_get_double self
180
186
 
@@ -250,6 +256,7 @@ module GObject
250
256
 
251
257
  attach_function :g_value_set_boolean, [GValue.ptr, :int], :void
252
258
  attach_function :g_value_set_int, [GValue.ptr, :int], :void
259
+ attach_function :g_value_set_uint64, [GValue.ptr, :uint64], :void
253
260
  attach_function :g_value_set_double, [GValue.ptr, :double], :void
254
261
  attach_function :g_value_set_enum, [GValue.ptr, :int], :void
255
262
  attach_function :g_value_set_flags, [GValue.ptr, :uint], :void
@@ -258,6 +265,7 @@ module GObject
258
265
 
259
266
  attach_function :g_value_get_boolean, [GValue.ptr], :int
260
267
  attach_function :g_value_get_int, [GValue.ptr], :int
268
+ attach_function :g_value_get_uint64, [GValue.ptr], :uint64
261
269
  attach_function :g_value_get_double, [GValue.ptr], :double
262
270
  attach_function :g_value_get_enum, [GValue.ptr], :int
263
271
  attach_function :g_value_get_flags, [GValue.ptr], :int
@@ -16,7 +16,6 @@ module Vips
16
16
 
17
17
  attach_function :vips_filename_get_filename, [:string], :string
18
18
  attach_function :vips_filename_get_options, [:string], :string
19
- attach_function :vips_filename_get_options, [:string], :string
20
19
 
21
20
  attach_function :vips_foreign_find_load, [:string], :string
22
21
  attach_function :vips_foreign_find_save, [:string], :string
@@ -252,13 +251,13 @@ module Vips
252
251
  # strings or appended as a hash. For example:
253
252
  #
254
253
  # ```
255
- # image = Vips::new_from_from_buffer memory_buffer, "shrink=2"
254
+ # image = Vips::Image.new_from_buffer memory_buffer, "shrink=2"
256
255
  # ```
257
256
  #
258
257
  # or alternatively:
259
258
  #
260
259
  # ```
261
- # image = Vips::new_from_from_buffer memory_buffer, "", shrink: 2
260
+ # image = Vips::Image.new_from_buffer memory_buffer, "", shrink: 2
262
261
  # ```
263
262
  #
264
263
  # The options available depend on the file format. Try something like:
@@ -279,7 +278,7 @@ module Vips
279
278
  # @macro vips.loadopts
280
279
  # @return [Image] the loaded image
281
280
  def self.new_from_buffer data, option_string, opts = {}
282
- loader = Vips::vips_foreign_find_load_buffer data, data.length
281
+ loader = Vips::vips_foreign_find_load_buffer data, data.bytesize
283
282
  raise Vips::Error if loader == nil
284
283
 
285
284
  Vips::Operation.call loader, [data], opts, option_string
@@ -539,7 +538,7 @@ module Vips
539
538
  # For example, you can use this to set an image's ICC profile:
540
539
  #
541
540
  # ```
542
- # x = y.set Vips::BLOB_TYPE, "icc-profile-data", profile
541
+ # x = y.set_type Vips::BLOB_TYPE, "icc-profile-data", profile
543
542
  # ```
544
543
  #
545
544
  # where `profile` is an ICC profile held as a binary string object.
@@ -693,11 +692,27 @@ module Vips
693
692
  [width, height]
694
693
  end
695
694
 
695
+ # Copy an image to a memory area.
696
+ #
697
+ # This can be useful for reusing results, but can obviously use a lot of
698
+ # memory for large images. See {Image#tilecache} for a way of caching
699
+ # parts of an image.
700
+ #
701
+ # @return [Image] new memory image
696
702
  def copy_memory
697
703
  new_image = Vips::vips_image_copy_memory self
698
704
  Vips::Image.new new_image
699
705
  end
700
706
 
707
+ # Draw a point on an image.
708
+ #
709
+ # See {Image#draw_rect}.
710
+ #
711
+ # @return [Image] modified image
712
+ def draw_point ink, left, top, opts = {}
713
+ draw_rect ink, left, top, 1, 1, opts
714
+ end
715
+
701
716
  # Add an image, constant or array.
702
717
  #
703
718
  # @param other [Image, Real, Array<Real>] Thing to add to self
@@ -1,4 +1,4 @@
1
1
  module Vips
2
- VERSION = "2.0.9"
2
+ VERSION = "2.0.10"
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.9
4
+ version: 2.0.10
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-12-21 00:00:00.000000000 Z
11
+ date: 2018-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -149,6 +149,7 @@ files:
149
149
  - lib/vips/angle45.rb
150
150
  - lib/vips/bandformat.rb
151
151
  - lib/vips/coding.rb
152
+ - lib/vips/compass_direction.rb
152
153
  - lib/vips/direction.rb
153
154
  - lib/vips/extend.rb
154
155
  - lib/vips/gobject.rb
@@ -192,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
193
  version: '0'
193
194
  requirements: []
194
195
  rubyforge_project:
195
- rubygems_version: 2.5.2
196
+ rubygems_version: 2.5.2.1
196
197
  signing_key:
197
198
  specification_version: 4
198
199
  summary: Ruby extension for the vips image processing library.