vips 8.6.3.2 → 8.8.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +27 -22
  3. data/CHANGELOG.md +273 -0
  4. data/example/annotate.rb +2 -2
  5. data/example/daltonize8.rb +26 -28
  6. data/example/example1.rb +1 -2
  7. data/example/example2.rb +6 -6
  8. data/example/example3.rb +5 -5
  9. data/example/example4.rb +6 -6
  10. data/example/example5.rb +6 -7
  11. data/example/inheritance_with_refcount.rb +201 -218
  12. data/example/thumb.rb +10 -12
  13. data/example/trim8.rb +6 -6
  14. data/example/watermark.rb +14 -35
  15. data/example/wobble.rb +24 -24
  16. data/lib/vips.rb +335 -312
  17. data/lib/vips/access.rb +9 -9
  18. data/lib/vips/align.rb +7 -8
  19. data/lib/vips/angle.rb +8 -9
  20. data/lib/vips/angle45.rb +12 -13
  21. data/lib/vips/bandformat.rb +16 -18
  22. data/lib/vips/blend_mode.rb +32 -0
  23. data/lib/vips/coding.rb +11 -12
  24. data/lib/vips/compass_direction.rb +13 -14
  25. data/lib/vips/direction.rb +7 -8
  26. data/lib/vips/extend.rb +13 -14
  27. data/lib/vips/gobject.rb +92 -96
  28. data/lib/vips/gvalue.rb +231 -237
  29. data/lib/vips/image.rb +1329 -1330
  30. data/lib/vips/interesting.rb +10 -11
  31. data/lib/vips/interpolate.rb +49 -54
  32. data/lib/vips/interpretation.rb +25 -26
  33. data/lib/vips/kernel.rb +18 -19
  34. data/lib/vips/methods.rb +2319 -2141
  35. data/lib/vips/object.rb +204 -213
  36. data/lib/vips/operation.rb +317 -323
  37. data/lib/vips/operationboolean.rb +10 -11
  38. data/lib/vips/operationcomplex.rb +8 -9
  39. data/lib/vips/operationcomplex2.rb +6 -7
  40. data/lib/vips/operationcomplexget.rb +7 -8
  41. data/lib/vips/operationmath.rb +14 -15
  42. data/lib/vips/operationmath2.rb +6 -7
  43. data/lib/vips/operationrelational.rb +11 -12
  44. data/lib/vips/operationround.rb +7 -8
  45. data/lib/vips/size.rb +9 -10
  46. data/lib/vips/version.rb +1 -1
  47. data/vips.gemspec +1 -1
  48. metadata +9 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 782be5f76a6da8fffdaae9909bcc0480615cbf239a79544a23caa53c9b960df7
4
- data.tar.gz: ecfbadbbaa5bc7aafe2db149f2bb486980bbfd08f6431257ec5e184cf01ef922
3
+ metadata.gz: c319f9bb724f5a042a4b1484b576ad6e687f96b0a2d44c4bbd7aca84589a9a65
4
+ data.tar.gz: 5145713638db4c7600735991c3b625e18b3f4ea806f6bbd489c80e19535168d2
5
5
  SHA512:
6
- metadata.gz: '08b3cec5c7cd6576511292e37e696e8a0d1e77b0b513e2066ffa5e9a83bcb37b4e1c262a9de7c6085d77d3d214a34be1c732db34df3221294b929c95d86cead8'
7
- data.tar.gz: 4e21e7eb3e2d4872001ba7408f2f5e91ae1809fbc549aca0dfb03f1c682466e12dd7c761708bc8e7b2639d80ecec46296644302fc820a523d9deae3c78d270fe
6
+ metadata.gz: 5568d82521bd9ba5599ed39a2ba27db1b5ca1dfb8ddfcf33d34e8fcd845f315aabceb405b98d826c64d60bd40367f215cd7fa177252111bf209c1b89455c502e
7
+ data.tar.gz: 4a7e90860ede9e95f3eee83cc1b94b36678ab55b75c349580407878a2a43ec2596aba5feca4e028d407e112efe8e533b556fd32224015a4b868a09f79a11aaf3
data/.travis.yml CHANGED
@@ -1,51 +1,56 @@
1
- os:
2
- - linux
3
- # - osx
4
-
5
- sudo: false
1
+ language: ruby
2
+ dist: xenial
3
+ cache: bundler
6
4
 
7
5
  addons:
8
6
  apt:
9
7
  packages:
10
8
  - libexpat1-dev
11
9
  - gettext
10
+ - libglib2.0-dev
11
+ - liborc-0.4-dev
12
+ - libfftw3-dev
12
13
  - liblcms2-dev
13
14
  - libmagickwand-dev
14
15
  - libopenexr-dev
15
16
  - libcfitsio3-dev
16
17
  - libgif-dev
17
- - libgs-dev
18
18
  - libgsf-1-dev
19
19
  - libmatio-dev
20
20
  - libopenslide-dev
21
- - liborc-0.4-dev
22
21
  - libpango1.0-dev
23
22
  - libpoppler-glib-dev
24
23
  - librsvg2-dev
25
24
  - libwebp-dev
26
- # missing on trusty, unfortunately
27
- # - libwebpmux2
28
- - libfftw3-dev
29
- - libglib2.0-dev
25
+ homebrew:
26
+ packages:
27
+ - glib
28
+ - libffi
29
+ - libexif
30
+ update: true
30
31
 
31
32
  cache:
32
33
  bundler: true
33
34
  directories: $HOME/vips/ext
34
35
 
35
- language: ruby
36
- rvm:
37
- - 2.3
38
- - 2.4
39
- - 2.5
40
- - 2.6
36
+ matrix:
37
+ include:
38
+ - rvm: 2.4
39
+ - rvm: 2.5
40
+ - rvm: 2.6
41
+ - rvm: 2.6
42
+ os: osx
43
+ env: PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
44
+ - rvm: truffleruby
45
+ - rvm: jruby-head
46
+ - rvm: ruby-head
47
+ allow_failures:
48
+ - rvm: truffleruby
49
+ - rvm: ruby-head
50
+ - rvm: jruby-head
41
51
 
42
52
  before_script:
43
- - gem update --system
44
- - gem install bundler
45
53
  - bundle exec rake ext
46
54
 
47
55
  script:
48
56
  - bundle exec rake
49
-
50
- gemfile:
51
- - Gemfile
data/CHANGELOG.md ADDED
@@ -0,0 +1,273 @@
1
+ # Changelog
2
+
3
+ ## master
4
+
5
+ ## Version 2.0.15 (2019-6-12)
6
+
7
+ * better error messages from `write_to_memory` [linkyndy]
8
+ * fix doc generation typo for array return [jcupitt]
9
+ * update tests for libvips 8.8 [jcupitt]
10
+
11
+ ## Version 2.0.14 (2018-10-3)
12
+
13
+ * update links for new home [jcupitt]
14
+ * various doc fixes [janko-m]
15
+ * add `Vips::get_suffixes` [jcupitt]
16
+ * prefer options splat [ioquatix]
17
+ * update docs for 8.8 [jcupitt]
18
+
19
+ ## Version 2.0.13 (2018-8-6)
20
+
21
+ * allow optional args to have `nil` as a value [janko-m]
22
+ * fix five small memleaks [kleisauke]
23
+
24
+ ## Version 2.0.12 (2018-4-25)
25
+
26
+ * fix `Vips::Image#has_alpha?` with older libvips [larskanis]
27
+
28
+ ## Version 2.0.11 (2018-4-23)
29
+
30
+ * fix init with older glib [lsat12357]
31
+ * add `Vips::Image#has_alpha?` and `#add_alpha` [aried3r]
32
+
33
+ ## Version 2.0.10 (2017-12-21)
34
+
35
+ * add support for uint64 parameters
36
+ * add `draw_point` convenience method
37
+ * add docs for `CompassDirection` [janko-m]
38
+ * add `MAX_COORD` constant
39
+ * doc fixes [janko-m]
40
+ * remove duplicate function attach [janko-m]
41
+ * fix a crash with `new_from_buffer` with a UTF-8 string [janko-m]
42
+
43
+ ## Version 2.0.9 (2017-12-21)
44
+
45
+ * update docs for libvips 8.6
46
+
47
+ ## Version 2.0.8 (2017-09-14)
48
+
49
+ * add `thumb.rb` example, and verify we run stably and in constant memory
50
+ * cleanups and polish [Nakilon]
51
+ * add `composite` convenience method
52
+ * add `Vips::concurrency_set` and `Vips::vector_set`
53
+
54
+ ## Version 2.0.7 (2017-09-08)
55
+
56
+ * disable the logging for now, it could deadlock
57
+
58
+ ## Version 2.0.6 (2017-09-02)
59
+
60
+ * improve get() behaviour on error with older libvipses
61
+
62
+ ## Version 2.0.5 (2017-09-02)
63
+
64
+ * fix get() with older libvipses
65
+
66
+ ## Version 2.0.4 (2017-09-02)
67
+
68
+ * add a test for `get_fields`, since it appeared in libvips 8.5 (thanks zverok)
69
+
70
+ ## Version 2.0.3 (2017-09-02)
71
+
72
+ * add `get_fields`
73
+
74
+ ## Version 2.0.2 (2017-08-26)
75
+
76
+ * switch to `logger` for all logging output
77
+ * add libvips cache control functions `Vips::cache_set_max()` etc.
78
+ * fix a ref leak
79
+
80
+ ## Version 2.0.1 (2017-08-23)
81
+
82
+ * add support for `VipsRefStr` in gvalue, thanks tomasc
83
+
84
+ ## Version 2.0.0 (2017-08-22)
85
+
86
+ * rewrite on top of 'ffi' [John Cupitt, Kleis Auke Wolthuizen]
87
+
88
+ ## Version 1.0.6 (2017-07-17)
89
+
90
+ * remove lazy load, fixing a race with multi-threading [felixbuenemann]
91
+ * make `Image#to_a` much faster [John Cupitt]
92
+ * remove the `at_exit` handler [John Cupitt]
93
+
94
+ ## Version 1.0.5 (2017-04-29)
95
+
96
+ * fix `_const` for libvips 8.5 [John Cupitt]
97
+ * add `scaleimage`, the scale operation renamed to avoid a clash with the
98
+ `scale` property [John Cupitt]
99
+ * add `.new_from_image`: make a new image from a constant [John Cupitt]
100
+ * `bandjoin` will use `bandjoin_const`, if it can [John Cupitt]
101
+ * update generated docs for libvips 8.5 [John Cupitt]
102
+ * added docs for new libvips 8.5 enums [John Cupitt]
103
+
104
+ ## Version 1.0.4 (2017-02-07)
105
+
106
+ * remove stray comma from some docs lines [John Cupitt]
107
+ * update generated docs for libvips 8.5 [John Cupitt]
108
+ * small doc improvements [John Cupitt]
109
+ * update for gobject-introspection 3.1 [John Cupitt]
110
+ * support ruby 2.4 [John Cupitt]
111
+
112
+ ## Version 1.0.3 (2016-08-18)
113
+
114
+ * doc improvements [John Cupitt]
115
+ * add `Image#size` to get `[width, height]` [John Cupitt]
116
+ * only ask for ruby 2.0 to help OS X [John Cupitt]
117
+ * break up `Image.call` to make it easier to understand [John Cupitt]
118
+ * detect operation build fail correctly [John Cupitt]
119
+ * lock gobject-introspection at 3.0.8 to avoid breakage [John Cupitt]
120
+
121
+ ## Version 1.0.2 (2016-07-07)
122
+
123
+ * add `.yardopts` to fix ruby-gems docs [John Cupitt]
124
+
125
+ ## Version 1.0.1 (2016-07-07)
126
+
127
+ * simplify gemspec [sandstrom]
128
+ * remove jeweler dependency [John Cupitt]
129
+ * add `.to_a` to Image [John Cupitt]
130
+
131
+ ## Version 1.0.0 (2016-06-07)
132
+
133
+ * complete rewrite, API break [John Cupitt]
134
+
135
+ ## Version 0.3.14 (2016-01-25)
136
+
137
+ * more GC tuning [felixbuenemann]
138
+ * add `write.rb` example program [felixbuenemann]
139
+
140
+ ## Version 0.3.13 (2016-01-18)
141
+
142
+ * don't use generational GC options on old Rubys [John Cupitt]
143
+
144
+ ## Version 0.3.12 (2016-01-17)
145
+
146
+ * incremental GC every 10 writes [felixbuenemann]
147
+ * updated bundle [John Cupitt]
148
+
149
+ ## Version 0.3.11 (2015-10-15)
150
+
151
+ * added magick load from buffer [John Cupitt]
152
+
153
+ ## Version 0.3.10 (2015-06-24)
154
+
155
+ * added webp write [John Cupitt]
156
+
157
+ ## Version 0.3.9 (2014-07-17)
158
+
159
+ * removed a stray file from gemspec [Alessandro Tagliapietra]
160
+ * updated bundle [John Cupitt]
161
+ * revised spec tests [John Cupitt]
162
+ * fix a segv in im.label_regions [John Cupitt]
163
+ * add a Valgrind suppressions file [John Cupitt]
164
+ * fix .monotonic? [John Cupitt]
165
+ * fix .data on coded images [John Cupitt]
166
+ * add .size, see issue #58 [John Cupitt]
167
+ * add rdoc-data dep, maybe it will help ruby-gems docs [John Cupitt]
168
+
169
+ ## Version 0.3.8 (2014-05-11)
170
+
171
+ * add VIPS::thread_shutdown(), must be called on foreign thread exit [John Cupitt]
172
+
173
+ ## Version 0.3.7 (2014-02-04)
174
+
175
+ * update build dependencies [John Cupitt]
176
+ * README updated [John Cupitt]
177
+
178
+ ## Version 0.3.6 (2013-06-25)
179
+
180
+ * add png and jpg load from memory buffer [John Cupitt]
181
+ * README updated to include buffer read/write example [John Cupitt]
182
+ * better vips version testing [John Cupitt]
183
+ * spec tests for new buffer read/write code [John Cupitt]
184
+ * fix rdoc build to include C sources [John Cupitt]
185
+ * better compat with older libvips [John Cupitt]
186
+
187
+ ## Version 0.3.5 (2013-01-15)
188
+
189
+ * rb_raise() in mask.c no longer passes a string pointer as the fmt arg, stopping gcc bailing out on some platforms [John Cupitt]
190
+ * Image.magick() now calls im_magick2vips() directly rather than relying on libvips file type sniffing [John Cupitt]
191
+
192
+ ## Version 0.3.4 (2012-09-11)
193
+
194
+ * Update specs for lcms changes, thanks Stanislaw [John Cupitt]
195
+ * VIPS::Reader supports .exif() / .exif?() methods for better back compat, thanks Jeremy [John Cupitt]
196
+ * VIPS::Reader fallbacks load the image if its not been loaded [John Cupitt]
197
+ * VIPS::Reader no longer allows VIPS::Header methods [John Cupitt]
198
+
199
+ ## Version 0.3.3 (2012-08-31)
200
+
201
+ * Typo in workaround in 0.3.2 [John Cupitt]
202
+
203
+ ## Version 0.3.2 (2012-08-31)
204
+
205
+ ### Fixed
206
+
207
+ * Workaround helps ruby-vips compile (and run) against 7.26.3 [John Cupitt and
208
+ James Harrison]
209
+
210
+ ## Version 0.3.1 (2012-08-30)
211
+
212
+ ### Fixed
213
+
214
+ * PNG writer no longer changes the filename argument [John Cupitt]
215
+ * Workaround helps ruby-vips compile against 7.26.3 [John Cupitt]
216
+ * Image read now runs GC and retries on fail [John Cupitt]
217
+ * Image write GCs every 100 images [John Cupitt]
218
+
219
+ ## Version 0.3.0 (2012-07-20)
220
+
221
+ ### Added
222
+
223
+ * More rspec tests [John Cupitt]
224
+ * Updated to libvips-7.30 [John Cupitt]
225
+
226
+ ### Changed
227
+
228
+ * Reworked Reader class offers better performance and compatibility [John
229
+ Cupitt]
230
+ * Don't use :sequential option for older libvipses [John Cupitt]
231
+ * Rename "tone_analyze" as "tone_analyse" for consistency with the rest of
232
+ vips [John CUpitt]
233
+
234
+ ### Fixed
235
+
236
+ * Now passes rspec test suite cleanly in valgrind [John Cupitt]
237
+ * Fixed check of sequential mode support [Stanislaw Pankevich]
238
+
239
+ ## Version 0.2.0 (2012-06-29)
240
+
241
+ ### Added
242
+
243
+ * Add tile_cache [John Cupitt]
244
+ * Add :sequential option to tiff, jpeg and png readers [John Cupitt]
245
+ * Add raise if suitable pkg_config for libvips is not found, thanks to Pierre
246
+ Chapuis [Stanislaw Pankevich]
247
+ * Add backward compatibility of 0.1.x ruby-vips with libvips versions less than 7.28 [John Cupitt]
248
+ * Add Travis. ruby-vips now is being tested on travis-ci.org. [Stanislaw Pankevich]
249
+
250
+ ### Changed
251
+
252
+ * Disable the vips8 operation cache to save some memory [John Cupitt]
253
+ * Update example shrinker [John Cupitt]
254
+
255
+ ### Fixed
256
+
257
+ * #8: Memory allocation-free issues [Grigoriy Chudnov]
258
+
259
+ ## Version 0.1.1 (2012-06-22)
260
+
261
+ ### Changed
262
+
263
+ * Upgrade spec/* code to latest RSpec [Stanislaw Pankevich]
264
+
265
+ ### Added
266
+
267
+ * Added CHANGELOG.md file (thanks to jnicklas/capybara - using the layout of their History.txt) [Stanislaw Pankevich]
268
+ * Added Gemfile with the only 'rspec' dependency. [Stanislaw Pankevich]
269
+ * Added Jeweler Rakefile contents to release ruby-vips as a gem. [Stanislaw Pankevich]
270
+
271
+ ## Before (initial unreleased version 0.1.0)
272
+
273
+ Long-long history here undocumented...
data/example/annotate.rb CHANGED
@@ -5,13 +5,13 @@ require 'vips'
5
5
  im = Vips::Image.new_from_file ARGV[0], :access => :sequential
6
6
 
7
7
  left_text = Vips::Image.text "left corner", :dpi => 300
8
- left = left_text.embed 50, 50, im.width, 150
8
+ left = left_text.embed 50, 50, im.width, 150
9
9
 
10
10
  right_text = Vips::Image.text "right corner", :dpi => 300
11
11
  right = right_text.embed im.width - right_text.width - 50, 50, im.width, 150
12
12
 
13
13
  footer = (left | right).ifthenelse(0, [255, 0, 0], :blend => true)
14
14
 
15
- im = im.insert footer, 0, im.height, :expand => true
15
+ im = im.insert footer, 0, im.height, :expand => true
16
16
 
17
17
  im.write_to_file ARGV[1]
@@ -9,18 +9,18 @@
9
9
 
10
10
  require 'vips'
11
11
 
12
- #Vips.set_debug true
12
+ # Vips.set_debug true
13
13
 
14
14
  # matrices to convert D65 XYZ to and from bradford cone space
15
15
  xyz_to_brad = [
16
- [0.8951, 0.2664, -0.1614],
17
- [-0.7502, 1.7135, 0.0367],
18
- [0.0389, -0.0685, 1.0296]
16
+ [0.8951, 0.2664, -0.1614],
17
+ [-0.7502, 1.7135, 0.0367],
18
+ [0.0389, -0.0685, 1.0296]
19
19
  ]
20
20
  brad_to_xyz = [
21
- [0.987, -0.147, 0.16],
22
- [0.432, 0.5184, 0.0493],
23
- [-0.0085, 0.04, 0.968]
21
+ [0.987, -0.147, 0.16],
22
+ [0.432, 0.5184, 0.0493],
23
+ [-0.0085, 0.04, 0.968]
24
24
  ]
25
25
 
26
26
  im = Vips::Image.new_from_file ARGV[0]
@@ -28,48 +28,46 @@ im = Vips::Image.new_from_file ARGV[0]
28
28
  # remove any alpha channel before processing
29
29
  alpha = nil
30
30
  if im.bands == 4
31
- alpha = im[3]
32
- im = im.extract_band 0, :n => 3
31
+ alpha = im[3]
32
+ im = im.extract_band 0, :n => 3
33
33
  end
34
34
 
35
35
  begin
36
- # import to XYZ with lcms
37
- # if there's no profile there, we'll fall back to the thing below
38
- xyz = im.icc_import :embedded => true, :pcs => :xyz
36
+ # import to XYZ with lcms
37
+ # if there's no profile there, we'll fall back to the thing below
38
+ xyz = im.icc_import :embedded => true, :pcs => :xyz
39
39
  rescue Vips::Error
40
- # nope .. use the built-in converter instead
41
- xyz = im.colourspace :xyz
40
+ # nope .. use the built-in converter instead
41
+ xyz = im.colourspace :xyz
42
42
  end
43
43
 
44
- brad = xyz.recomb xyz_to_brad
44
+ brad = xyz.recomb xyz_to_brad
45
45
 
46
46
  # through the Deuteranope matrix
47
47
  # we need rows to sum to 1 in Bradford space --- the matrix in the original
48
48
  # Python code sums to 1.742
49
49
  deut = brad.recomb [
50
- [1, 0, 0],
51
- [0.7, 0, 0.3],
52
- [0, 0, 1]
50
+ [1, 0, 0],
51
+ [0.7, 0, 0.3],
52
+ [0, 0, 1]
53
53
  ]
54
54
 
55
- xyz = deut.recomb brad_to_xyz
55
+ xyz = deut.recomb brad_to_xyz
56
56
 
57
- # .. and back to sRGB
57
+ # .. and back to sRGB
58
58
  rgb = xyz.colourspace :srgb
59
59
 
60
- # so this is the colour error
60
+ # so this is the colour error
61
61
  err = im - rgb
62
62
 
63
63
  # add the error back to other channels to make a compensated image
64
- im = im + err.recomb([
65
- [0, 0, 0],
66
- [0.7, 1, 0],
67
- [0.7, 0, 1]
68
- ])
64
+ im = im + err.recomb([[0, 0, 0],
65
+ [0.7, 1, 0],
66
+ [0.7, 0, 1]])
69
67
 
70
68
  # reattach any alpha we saved above
71
69
  if alpha
72
- im = im.bandjoin(alpha)
70
+ im = im.bandjoin(alpha)
73
71
  end
74
72
 
75
- im.write_to_file ARGV[1]
73
+ im.write_to_file ARGV[1]