ruby-vips 2.1.4 → 2.2.0

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
  SHA256:
3
- metadata.gz: ff74e4e7a8b781e9fd56602fddc00adaa0355276532821a953bac3175e649534
4
- data.tar.gz: 199957dacc1c47208a5d8a379080b76676fe3f98ba684a76fdbe5e08370d535b
3
+ metadata.gz: 13cfcbea0e56ad3823bf1da4e035884d934253c729d74da5f54c77e87e949c5a
4
+ data.tar.gz: ebd97fa16da17c0f932bccb49d21d5b1dcaa024e32ace5c3335f093b2043efea
5
5
  SHA512:
6
- metadata.gz: 9d585d3440f75759e1c07cefd6d43371db62706e0c2e9ada3512f661870f7f4c410d6dbeed138c45e16438112cc8179bae2d4477c318ac6fcf9e31487822cb63
7
- data.tar.gz: a62254d063cd35b521e74a86377d3e83d2b2345a10186e044b2e91992bc6ff49611d6bde916cd8c530d0b2ba4da7ba4a23ca10c922be99463ab71371538cf1cf
6
+ metadata.gz: a7ff0c920fa2ccfe60e9b1762fce6efaa94413f5a68453156eaa7cad6a63cdbab3639ecc525c52cb11578684bc02e9868b7643ab4bc89a8f23905c7dae0b06c1
7
+ data.tar.gz: c258fc41dca1d105aa4617bac9a3092a8ea3ce7a2bf41f0ad37aac1baa3ebcdce9a3353a4be014b9748e8e141ca15916b67f789cb1fab76c8a5647832aa2efd0
@@ -38,15 +38,17 @@ jobs:
38
38
  matrix:
39
39
  os-version: [ 'ubuntu-20.04' ]
40
40
  ruby-version:
41
- - 2.0
42
- - 2.1
43
- - 2.2
44
- - 2.3
45
- - 2.4
46
- - 2.5
47
- - 2.6
48
- - 2.7
49
- - 3.0
41
+ - '2.0'
42
+ - '2.1'
43
+ - '2.2'
44
+ - '2.3'
45
+ - '2.4'
46
+ - '2.5'
47
+ - '2.6'
48
+ - '2.7'
49
+ - '3.0'
50
+ - '3.1'
51
+ - '3.2'
50
52
  - jruby
51
53
  fail-fast: true
52
54
 
@@ -54,7 +56,7 @@ jobs:
54
56
 
55
57
  steps:
56
58
  - name: Checkout code
57
- uses: actions/checkout@v2
59
+ uses: actions/checkout@v3
58
60
 
59
61
  - name: Set up Ruby
60
62
  uses: ruby/setup-ruby@v1
data/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## Version 2.2.0 (2023-10-18)
6
+
7
+ * add `draw_point!` [jcupitt]
8
+ * add `Vips.tracked_*` for getting file and memory metrics [jeremy]
9
+ * add `Vips.cache_*` for getting cache settings [jeremy]
10
+ * add `Vips.vector?` to get/set SIMD status [jeremy]
11
+ * add `Vips.concurrency` to get/set threadpool size [jeremy]
12
+ * add `Vips.concurrency_default` to get the default threadpool size [jeremy]
13
+ * fix targetcustom spec test with libvips 8.13 [lucaskanashiro]
14
+ * add ruby 3.2 to CI [petergoldstein]
15
+ * update docs for libvips 8.15 [jcupitt]
16
+
5
17
  ## Version 2.1.4 (2021-10-28)
6
18
 
7
19
  * `write_to_buffer` tries to use the new target API, then falls back to the old
data/README.md CHANGED
@@ -4,7 +4,10 @@
4
4
  [![Test](https://github.com/libvips/ruby-vips/workflows/Test/badge.svg)](https://github.com/libvips/ruby-vips/actions?query=workflow%3ATest)
5
5
 
6
6
  This gem is a Ruby binding for the [libvips image processing
7
- library](https://libvips.github.io/libvips).
7
+ library](https://libvips.github.io/libvips). It has been tested on
8
+ Linux, macOS and Windows, and with ruby 2, ruby 3 and jruby. It uses
9
+ [ruby-ffi](https://github.com/ffi/ffi) to call functions in the libvips
10
+ library.
8
11
 
9
12
  libvips is a [demand-driven, horizontally
10
13
  threaded](https://github.com/libvips/libvips/wiki/Why-is-libvips-quick)
@@ -14,32 +17,30 @@ memory](https://github.com/libvips/libvips/wiki/Speed-and-memory-use).
14
17
  libvips is licensed under the [LGPL
15
18
  2.1+](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html).
16
19
 
17
- ## Requirements
20
+ ## Install on linux and macOS
18
21
 
19
- * macOS, Linux, and Windows tested
22
+ Install the libvips binary with your package manager (eg. `apt install
23
+ libvips42` or perhaps `brew install vips`, see the [libvips install
24
+ instructions](https://libvips.github.io/libvips/install.html)) then install
25
+ this gem with:
20
26
 
21
- * libvips 8.2 or later, see the [libvips install instructions](https://libvips.github.io/libvips/install.html)
22
-
23
- * [ruby-ffi](https://github.com/ffi/ffi) 1.9 or later
27
+ ```
28
+ gem install ruby-vips
29
+ ```
24
30
 
25
- * Ruby 2.0+, JRuby
31
+ Or include `gem "ruby-vips"` in your gemfile.
26
32
 
27
- ## Install
33
+ ## Install on Windows
28
34
 
29
- [Install libvips](https://libvips.github.io/libvips/install.html), then:
35
+ The gemspec will pull in the msys libvips for you, so all you need is:
30
36
 
31
37
  ```
32
- $ gem install ruby-vips
38
+ gem install ruby-vips
33
39
  ```
34
40
 
35
- or include it in `Gemfile`:
41
+ Or include `gem "ruby-vips"` in your gemfile.
36
42
 
37
- ```ruby
38
- gem "ruby-vips"
39
- ```
40
-
41
- On Windows, you'll need to set the `RUBY_DLL_PATH` environment variable to
42
- point to the libvips bin directory.
43
+ Tested with the ruby and msys from choco, but others may work.
43
44
 
44
45
  ## Example
45
46
 
@@ -106,4 +107,3 @@ rmagick.rb 788768
106
107
 
107
108
  See also [benchmarks at the official libvips
108
109
  website](https://github.com/libvips/libvips/wiki/Speed-and-memory-use).
109
-
data/TODO CHANGED
@@ -37,8 +37,7 @@
37
37
 
38
38
  - Push new gem to rubygems, tag repository with version.
39
39
 
40
- gem signin --otp 111111
41
40
  bundle exec rake release
42
41
 
43
- The otp is from authy / google authenticator / etc.
42
+ You'll be asked for a otp from authy / google authenticator / etc.
44
43
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.4
1
+ 2.2.0
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/ruby
2
+
3
+ # demo the "revalidate" feature in libvips 8.15
4
+
5
+ require "fileutils"
6
+ require "vips"
7
+
8
+ if ARGV.length != 2
9
+ puts "usage: ./revalidate.rb IMAGE-FILE-1 IMAGE-FILE-2"
10
+ exit 1
11
+ end
12
+
13
+ if File.exist?("fred")
14
+ puts "file 'fred' exists, delete it first"
15
+ exit 1
16
+ end
17
+
18
+ puts "copying #{ARGV[0]} to fred ..."
19
+ FileUtils.cp(ARGV[0], "fred")
20
+
21
+ image1 = Vips::Image.new_from_file("fred")
22
+ puts "fred.width = #{image1.width}"
23
+
24
+ puts "copying #{ARGV[1]} to fred ..."
25
+ FileUtils.cp(ARGV[1], "fred")
26
+
27
+ puts "plain image open ..."
28
+ image2 = Vips::Image.new_from_file("fred")
29
+ puts "fred.width = #{image2.width}"
30
+
31
+ puts "opening with revalidate ..."
32
+ image2 = Vips::Image.new_from_file("fred", revalidate: true)
33
+ puts "fred.width = #{image2.width}"
34
+
35
+ puts "opening again, should get cached entry ..."
36
+ image2 = Vips::Image.new_from_file("fred")
37
+ puts "fred.width = #{image2.width}"
38
+
39
+ File.delete("fred")
data/lib/vips/image.rb CHANGED
@@ -138,14 +138,14 @@ module Vips
138
138
  image = image.cast :float
139
139
  end
140
140
 
141
- new_format = image.format == :double ? :dpcomplex : :complex
141
+ new_format = (image.format == :double) ? :dpcomplex : :complex
142
142
  image = image.copy format: new_format, bands: image.bands / 2
143
143
  end
144
144
 
145
145
  image = block.call(image)
146
146
 
147
147
  unless Image.complex? original_format
148
- new_format = image.format == :dpcomplex ? :double : :float
148
+ new_format = (image.format == :dpcomplex) ? :double : :float
149
149
  image = image.copy format: new_format, bands: image.bands * 2
150
150
  end
151
151