ruby-vips 2.0.12 → 2.0.13

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: c23989cf3757459c2ac719af2ace562ba8fbb290
4
- data.tar.gz: 4445f4c2deb1c2ce58ad8afdb2ed17ba9c8010cb
2
+ SHA256:
3
+ metadata.gz: e509c29533461f0e4654d1dd116f61b033d589d9f78924bd197cb303fc0d9d0e
4
+ data.tar.gz: bf53c311ee52c198b3288e6b11d773dda21403355b3704ecbc4652ce16d51d53
5
5
  SHA512:
6
- metadata.gz: 6fdc125a6e0748faad5db660d7c411cc9350a1f976f3ea63ecf92e5ce3d2eb0d7fa2200e788d52be5b672dc4a4f7482a43b0da1f0aea37e482e7f4da75f4bee5
7
- data.tar.gz: 06dcd680d0affffbf36268218f239ac5fc1a9282d2e3a75cbd667082c5715c1b37db5f476e53f312069cbe137b881adfb62fced83d6ce1ef15cd832ead93d288
6
+ metadata.gz: 7fcdf3c4f3d66ac3550d17bc45606831a3337a41d8b5af151ff6103bdf0e891036e9ff568930e29f3e045543719801e48ec938310809c4e98af2f4f7ac695031
7
+ data.tar.gz: 2ddd68fe1e1f9dcc2174757658d145d5d9777a18c27436758030e376049e956860f6b5d454fe2f1dc1728b17b27cbcf37e1fa3d301edee23a9a7b17f4d0ba874
@@ -1,40 +1,36 @@
1
+ dist: trusty
1
2
  sudo: false
2
3
 
3
4
  env:
4
5
  global:
5
6
  - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
6
7
  - VIPS_VERSION_MAJOR=8
7
- - VIPS_VERSION_MINOR=5
8
- - VIPS_VERSION_MICRO=7
8
+ - VIPS_VERSION_MINOR=6
9
+ - VIPS_VERSION_MICRO=4
9
10
  - PATH=$HOME/vips/bin:$PATH
10
11
  - LD_LIBRARY_PATH=$HOME/vips/lib:$LD_LIBRARY_PATH
11
12
  - PKG_CONFIG_PATH=$HOME/vips/lib/pkgconfig:$PKG_CONFIG_PATH
12
13
 
13
- dist: trusty
14
-
15
14
  addons:
16
15
  apt:
17
16
  packages:
18
17
  - libexpat1-dev
19
18
  - gettext
19
+ - libglib2.0-dev
20
+ - liborc-0.4-dev
21
+ - libfftw3-dev
20
22
  - liblcms2-dev
21
23
  - libmagickwand-dev
22
24
  - libopenexr-dev
23
25
  - libcfitsio3-dev
24
26
  - libgif-dev
25
- - libgs-dev
26
27
  - libgsf-1-dev
27
28
  - libmatio-dev
28
29
  - libopenslide-dev
29
- - liborc-0.4-dev
30
30
  - libpango1.0-dev
31
31
  - libpoppler-glib-dev
32
32
  - librsvg2-dev
33
33
  - libwebp-dev
34
- # missing on trusty, unfortunately
35
- # - libwebpmux2
36
- - libfftw3-dev
37
- - libglib2.0-dev
38
34
 
39
35
  cache:
40
36
  directories:
@@ -56,4 +52,4 @@ gemfile:
56
52
 
57
53
  before_install:
58
54
  - uname -a
59
- - bash install-vips.sh --without-python
55
+ - bash install-vips.sh
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## Version 2.0.13 (2018-8-6)
6
+
7
+ * allow optional args to have `nil` as a value [janko-m]
8
+ * fix five small memleaks [kleisauke]
9
+
5
10
  ## Version 2.0.12 (2018-4-25)
6
11
 
7
12
  * fix `Vips::Image#has_alpha?` with older libvips [larskanis]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.12
1
+ 2.0.13
@@ -14,8 +14,8 @@ module Vips
14
14
 
15
15
  attach_function :vips_image_copy_memory, [:pointer], :pointer
16
16
 
17
- attach_function :vips_filename_get_filename, [:string], :string
18
- attach_function :vips_filename_get_options, [:string], :string
17
+ attach_function :vips_filename_get_filename, [:string], :pointer
18
+ attach_function :vips_filename_get_options, [:string], :pointer
19
19
 
20
20
  attach_function :vips_foreign_find_load, [:string], :string
21
21
  attach_function :vips_foreign_find_save, [:string], :string
@@ -52,6 +52,12 @@ module Vips
52
52
 
53
53
  attach_function :nickname_find, :vips_nickname_find, [:GType], :string
54
54
 
55
+ # turn a raw pointer that must be freed into a self-freeing Ruby string
56
+ def self.p2str(pointer)
57
+ pointer = FFI::AutoPointer.new(pointer, GLib::G_FREE)
58
+ pointer.read_string
59
+ end
60
+
55
61
  public
56
62
 
57
63
  # This class represents a libvips image. See the {Vips} module documentation
@@ -250,8 +256,8 @@ module Vips
250
256
  # pass this
251
257
  raise Vips::Error, "filename is nil" if name == nil
252
258
 
253
- filename = Vips::vips_filename_get_filename name
254
- option_string = Vips::vips_filename_get_options name
259
+ filename = Vips::p2str(Vips::vips_filename_get_filename name)
260
+ option_string = Vips::p2str(Vips::vips_filename_get_options name)
255
261
  loader = Vips::vips_foreign_find_load filename
256
262
  raise Vips::Error if loader == nil
257
263
 
@@ -412,15 +418,15 @@ module Vips
412
418
  #
413
419
  # @param name [String] filename to write to
414
420
  def write_to_file name, opts = {}
415
- filename = Vips::vips_filename_get_filename name
416
- option_string = Vips::vips_filename_get_options name
421
+ filename = Vips::p2str(Vips::vips_filename_get_filename name)
422
+ option_string = Vips::p2str(Vips::vips_filename_get_options name)
417
423
  saver = Vips::vips_foreign_find_save filename
418
424
  if saver == nil
419
425
  raise Vips::Error, "No known saver for '#{filename}'."
420
426
  end
421
427
 
422
428
  Vips::Operation.call saver, [self, filename], opts, option_string
423
-
429
+
424
430
  write_gc
425
431
  end
426
432
 
@@ -450,8 +456,10 @@ module Vips
450
456
  # @macro vips.saveopts
451
457
  # @return [String] the image saved in the specified format
452
458
  def write_to_buffer format_string, opts = {}
453
- filename = Vips::vips_filename_get_filename format_string
454
- option_string = Vips::vips_filename_get_options format_string
459
+ filename =
460
+ Vips::p2str(Vips::vips_filename_get_filename format_string)
461
+ option_string =
462
+ Vips::p2str(Vips::vips_filename_get_options format_string)
455
463
  saver = Vips::vips_foreign_find_save_buffer filename
456
464
  if saver == nil
457
465
  raise Vips::Error, "No known saver for '#{filename}'."
@@ -316,6 +316,8 @@ module Vips
316
316
 
317
317
  # set all optional inputs
318
318
  optional.each do |key, value|
319
+ next if value.nil?
320
+
319
321
  arg_name = key.to_s
320
322
 
321
323
  if optional_input.has_key? arg_name
@@ -1,4 +1,4 @@
1
1
  module Vips
2
- VERSION = "2.0.12"
2
+ VERSION = "2.0.13"
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.12
4
+ version: 2.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Cupitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-25 00:00:00.000000000 Z
11
+ date: 2018-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
193
  version: '0'
194
194
  requirements: []
195
195
  rubyforge_project:
196
- rubygems_version: 2.5.2.1
196
+ rubygems_version: 2.7.6
197
197
  signing_key:
198
198
  specification_version: 4
199
199
  summary: Ruby extension for the vips image processing library.