vips 8.11.3 → 8.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +42 -0
- data/.github/workflows/development.yml +54 -0
- data/.standard.yml +17 -0
- data/.yardopts +0 -1
- data/CHANGELOG.md +323 -0
- data/Gemfile +3 -1
- data/README.md +29 -15
- data/Rakefile +23 -18
- data/TODO +43 -0
- data/example/annotate.rb +6 -6
- data/example/connection.rb +18 -9
- data/example/daltonize8.rb +6 -6
- data/example/draw_lines.rb +30 -0
- data/example/example1.rb +4 -4
- data/example/example2.rb +6 -6
- data/example/example3.rb +5 -5
- data/example/example4.rb +2 -2
- data/example/example5.rb +4 -4
- data/example/inheritance_with_refcount.rb +46 -39
- data/example/progress.rb +3 -3
- data/example/thumb.rb +6 -6
- data/example/trim8.rb +1 -1
- data/example/watermark.rb +2 -2
- data/example/wobble.rb +1 -1
- data/lib/vips/blend_mode.rb +29 -25
- data/lib/vips/connection.rb +4 -4
- data/lib/vips/gobject.rb +18 -11
- data/lib/vips/gvalue.rb +54 -54
- data/lib/vips/image.rb +362 -169
- data/lib/vips/interpolate.rb +3 -2
- data/lib/vips/methods.rb +2877 -2319
- data/lib/vips/mutableimage.rb +173 -0
- data/lib/vips/object.rb +81 -88
- data/lib/vips/operation.rb +175 -82
- data/lib/vips/region.rb +6 -6
- data/lib/vips/source.rb +11 -12
- data/lib/vips/sourcecustom.rb +7 -8
- data/lib/vips/target.rb +12 -13
- data/lib/vips/targetcustom.rb +9 -10
- data/lib/vips/version.rb +1 -1
- data/lib/vips.rb +129 -82
- data/vips.gemspec +3 -3
- metadata +26 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 872a3771eee6d56c17254a27013a7ff1d002506965bf488fad3d055817457f1a
|
4
|
+
data.tar.gz: 76930aa9a3b5456460be220e3373c3a7ff573a86f18c3e07a3cd4ebbf37614af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51239e27dfe2b430985f875150abc758f2f4756fca00647e4c976ff36e4569da42a67bf236988bb244c3e4c8d2043d1d2308baceb58833accb0434460fc2ca87
|
7
|
+
data.tar.gz: 11e11cfdece5955686490f861ef20abcfd283d1d2875f5c7212cfabd0bf03aff8589e085e9277b61cd8d0bb71fef6db309617d93134590e574b6817722637d81
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve
|
4
|
+
title: ''
|
5
|
+
labels: bug
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Questions or suggestions**
|
11
|
+
|
12
|
+
We are using [Discussions](https://github.com/libvips/ruby-vips/discussions) for questions and suggestions for new features. Issues are only for bug reports.
|
13
|
+
|
14
|
+
**Describe the bug**
|
15
|
+
A clear and concise description of what the bug is.
|
16
|
+
|
17
|
+
**To Reproduce**
|
18
|
+
Steps to reproduce the behavior:
|
19
|
+
1. Go to '...'
|
20
|
+
2. Click on '....'
|
21
|
+
3. Scroll down to '....'
|
22
|
+
4. See error
|
23
|
+
|
24
|
+
**Expected behavior**
|
25
|
+
A clear and concise description of what you expected to happen.
|
26
|
+
|
27
|
+
**Screenshots**
|
28
|
+
If applicable, add screenshots to help explain your problem.
|
29
|
+
|
30
|
+
**Desktop (please complete the following information):**
|
31
|
+
- OS: [e.g. iOS]
|
32
|
+
- Browser [e.g. chrome, safari]
|
33
|
+
- Version [e.g. 22]
|
34
|
+
|
35
|
+
**Smartphone (please complete the following information):**
|
36
|
+
- Device: [e.g. iPhone6]
|
37
|
+
- OS: [e.g. iOS8.1]
|
38
|
+
- Browser [e.g. stock browser, safari]
|
39
|
+
- Version [e.g. 22]
|
40
|
+
|
41
|
+
**Additional context**
|
42
|
+
Add any other context about the problem here.
|
@@ -0,0 +1,54 @@
|
|
1
|
+
name: Development
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
name: ${{matrix.ruby}} on ${{matrix.os}}
|
8
|
+
runs-on: ${{matrix.os}}-latest
|
9
|
+
continue-on-error: ${{matrix.experimental}}
|
10
|
+
|
11
|
+
strategy:
|
12
|
+
matrix:
|
13
|
+
os:
|
14
|
+
- ubuntu
|
15
|
+
# - macos
|
16
|
+
|
17
|
+
ruby:
|
18
|
+
- "2.6"
|
19
|
+
- "2.7"
|
20
|
+
- "3.0"
|
21
|
+
- "3.1"
|
22
|
+
|
23
|
+
experimental: [false]
|
24
|
+
env: [""]
|
25
|
+
|
26
|
+
include:
|
27
|
+
- os: ubuntu
|
28
|
+
ruby: truffleruby
|
29
|
+
experimental: true
|
30
|
+
- os: ubuntu
|
31
|
+
ruby: jruby
|
32
|
+
experimental: true
|
33
|
+
- os: ubuntu
|
34
|
+
ruby: head
|
35
|
+
experimental: true
|
36
|
+
|
37
|
+
steps:
|
38
|
+
- uses: actions/checkout@v2
|
39
|
+
- uses: ruby/setup-ruby@v1
|
40
|
+
with:
|
41
|
+
ruby-version: ${{matrix.ruby}}
|
42
|
+
bundler-cache: true
|
43
|
+
|
44
|
+
- name: Install libvips
|
45
|
+
env:
|
46
|
+
DEBIAN_FRONTEND: noninteractive
|
47
|
+
run: |
|
48
|
+
sudo apt-get update -qq -o Acquire::Retries=3
|
49
|
+
sudo apt-get install --fix-missing -qq -o Acquire::Retries=3 libvips
|
50
|
+
bundle exec rake ext
|
51
|
+
|
52
|
+
- name: Run tests
|
53
|
+
timeout-minutes: 5
|
54
|
+
run: ${{matrix.env}} bundle exec rake spec
|
data/.standard.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
fix: false # default: false
|
2
|
+
parallel: true # default: false
|
3
|
+
format: progress # default: Standard::Formatter
|
4
|
+
ruby_version: 2.0 # default: RUBY_VERSION
|
5
|
+
default_ignores: false # default: true
|
6
|
+
|
7
|
+
ignore: # default: []
|
8
|
+
- '**/*':
|
9
|
+
- Standard/SemanticBlocks
|
10
|
+
- 'lib/vips/methods.rb'
|
11
|
+
- '{lib,example}/**/*':
|
12
|
+
- Lint/IneffectiveAccessModifier
|
13
|
+
- Lint/RescueException
|
14
|
+
- Style/GlobalVars
|
15
|
+
- 'spec/**/*':
|
16
|
+
- Lint/BinaryOperatorWithIdenticalOperands
|
17
|
+
- 'vendor/**/*'
|
data/.yardopts
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,323 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## master
|
4
|
+
|
5
|
+
## Version 2.1.4 (2021-10-28)
|
6
|
+
|
7
|
+
* `write_to_buffer` tries to use the new target API, then falls back to the old
|
8
|
+
buffer system [jcupitt]
|
9
|
+
* don't generate yard docs for deprecated args [jcupitt]
|
10
|
+
* add hyperbolic trig functions [jcupitt]
|
11
|
+
|
12
|
+
## Version 2.1.3 (2021-8-23)
|
13
|
+
|
14
|
+
* fix a gtype size error on win64 [danini-the-panini]
|
15
|
+
|
16
|
+
## Version 2.1.2 (2021-5-3)
|
17
|
+
|
18
|
+
* allow `FFI::Pointer` as an argument to `new_from_memory` etc. [sled]
|
19
|
+
|
20
|
+
## Version 2.1.1 (2021-5-3)
|
21
|
+
|
22
|
+
* fix "mutate" with libvips 8.9 [jcupitt]
|
23
|
+
* update autodocs for libvips 8.11 [jcupitt]
|
24
|
+
|
25
|
+
## Version 2.1.0 (2021-3-8)
|
26
|
+
|
27
|
+
* add "mutate" system [jcupitt]
|
28
|
+
* better behaviour with some nil parameters [jcupitt]
|
29
|
+
* revise gemspec [jcupitt]
|
30
|
+
* allow symbols for Interpolate.new [noraj]
|
31
|
+
* update docs for 8.10, fix minor doc formatting issues [jcupitt]
|
32
|
+
* `new_from_array` checks array argument more carefully [dkam]
|
33
|
+
* add `new_from_memory` and `new_from_memory_copy` [ankane]
|
34
|
+
* jruby added to CI testing [pftg]
|
35
|
+
* switch to github actions for CI [pftg]
|
36
|
+
* remove rubocop, revise formatting for standardrb [pftg]
|
37
|
+
|
38
|
+
## Version 2.0.17 (2019-10-29)
|
39
|
+
|
40
|
+
* install msys2 libvips on Windows [larskanis]
|
41
|
+
* better `-` to `_` conversion [Nakilon]
|
42
|
+
* fix `GValue#set` for stricter metadata rules in 8.9 [jcupitt]
|
43
|
+
* fix a ref leak on operation build error [jcupitt]
|
44
|
+
* faster operation call [jcupitt]
|
45
|
+
* add support for VipsConnection [jcupitt]
|
46
|
+
* add `signal_connect` [jcupitt]
|
47
|
+
* add `Image#set_kill` for progress termination [jcupitt]
|
48
|
+
|
49
|
+
## Version 2.0.16 (2019-9-21)
|
50
|
+
|
51
|
+
* better library name generation [renchap]
|
52
|
+
* allow `_` as a separator in enum names [D-W-L]
|
53
|
+
* add `Vips::Region` and `Region#fetch` [jcupitt]
|
54
|
+
|
55
|
+
## Version 2.0.15 (2019-6-12)
|
56
|
+
|
57
|
+
* better error messages from `write_to_memory` [linkyndy]
|
58
|
+
* fix doc generation typo for array return [jcupitt]
|
59
|
+
* update tests for libvips 8.8 [jcupitt]
|
60
|
+
|
61
|
+
## Version 2.0.14 (2018-10-3)
|
62
|
+
|
63
|
+
* update links for new home [jcupitt]
|
64
|
+
* various doc fixes [janko-m]
|
65
|
+
* add `Vips::get_suffixes` [jcupitt]
|
66
|
+
* prefer options splat [ioquatix]
|
67
|
+
* update docs for 8.8 [jcupitt]
|
68
|
+
|
69
|
+
## Version 2.0.13 (2018-8-6)
|
70
|
+
|
71
|
+
* allow optional args to have `nil` as a value [janko-m]
|
72
|
+
* fix five small memleaks [kleisauke]
|
73
|
+
|
74
|
+
## Version 2.0.12 (2018-4-25)
|
75
|
+
|
76
|
+
* fix `Vips::Image#has_alpha?` with older libvips [larskanis]
|
77
|
+
|
78
|
+
## Version 2.0.11 (2018-4-23)
|
79
|
+
|
80
|
+
* fix init with older glib [lsat12357]
|
81
|
+
* add `Vips::Image#has_alpha?` and `#add_alpha` [aried3r]
|
82
|
+
|
83
|
+
## Version 2.0.10 (2017-12-21)
|
84
|
+
|
85
|
+
* add support for uint64 parameters
|
86
|
+
* add `draw_point` convenience method
|
87
|
+
* add docs for `CompassDirection` [janko-m]
|
88
|
+
* add `MAX_COORD` constant
|
89
|
+
* doc fixes [janko-m]
|
90
|
+
* remove duplicate function attach [janko-m]
|
91
|
+
* fix a crash with `new_from_buffer` with a UTF-8 string [janko-m]
|
92
|
+
|
93
|
+
## Version 2.0.9 (2017-12-21)
|
94
|
+
|
95
|
+
* update docs for libvips 8.6
|
96
|
+
|
97
|
+
## Version 2.0.8 (2017-09-14)
|
98
|
+
|
99
|
+
* add `thumb.rb` example, and verify we run stably and in constant memory
|
100
|
+
* cleanups and polish [Nakilon]
|
101
|
+
* add `composite` convenience method
|
102
|
+
* add `Vips::concurrency_set` and `Vips::vector_set`
|
103
|
+
|
104
|
+
## Version 2.0.7 (2017-09-08)
|
105
|
+
|
106
|
+
* disable the logging for now, it could deadlock
|
107
|
+
|
108
|
+
## Version 2.0.6 (2017-09-02)
|
109
|
+
|
110
|
+
* improve get() behaviour on error with older libvipses
|
111
|
+
|
112
|
+
## Version 2.0.5 (2017-09-02)
|
113
|
+
|
114
|
+
* fix get() with older libvipses
|
115
|
+
|
116
|
+
## Version 2.0.4 (2017-09-02)
|
117
|
+
|
118
|
+
* add a test for `get_fields`, since it appeared in libvips 8.5 (thanks zverok)
|
119
|
+
|
120
|
+
## Version 2.0.3 (2017-09-02)
|
121
|
+
|
122
|
+
* add `get_fields`
|
123
|
+
|
124
|
+
## Version 2.0.2 (2017-08-26)
|
125
|
+
|
126
|
+
* switch to `logger` for all logging output
|
127
|
+
* add libvips cache control functions `Vips::cache_set_max()` etc.
|
128
|
+
* fix a ref leak
|
129
|
+
|
130
|
+
## Version 2.0.1 (2017-08-23)
|
131
|
+
|
132
|
+
* add support for `VipsRefStr` in gvalue, thanks tomasc
|
133
|
+
|
134
|
+
## Version 2.0.0 (2017-08-22)
|
135
|
+
|
136
|
+
* rewrite on top of 'ffi' [John Cupitt, Kleis Auke Wolthuizen]
|
137
|
+
|
138
|
+
## Version 1.0.6 (2017-07-17)
|
139
|
+
|
140
|
+
* remove lazy load, fixing a race with multi-threading [felixbuenemann]
|
141
|
+
* make `Image#to_a` much faster [John Cupitt]
|
142
|
+
* remove the `at_exit` handler [John Cupitt]
|
143
|
+
|
144
|
+
## Version 1.0.5 (2017-04-29)
|
145
|
+
|
146
|
+
* fix `_const` for libvips 8.5 [John Cupitt]
|
147
|
+
* add `scaleimage`, the scale operation renamed to avoid a clash with the
|
148
|
+
`scale` property [John Cupitt]
|
149
|
+
* add `.new_from_image`: make a new image from a constant [John Cupitt]
|
150
|
+
* `bandjoin` will use `bandjoin_const`, if it can [John Cupitt]
|
151
|
+
* update generated docs for libvips 8.5 [John Cupitt]
|
152
|
+
* added docs for new libvips 8.5 enums [John Cupitt]
|
153
|
+
|
154
|
+
## Version 1.0.4 (2017-02-07)
|
155
|
+
|
156
|
+
* remove stray comma from some docs lines [John Cupitt]
|
157
|
+
* update generated docs for libvips 8.5 [John Cupitt]
|
158
|
+
* small doc improvements [John Cupitt]
|
159
|
+
* update for gobject-introspection 3.1 [John Cupitt]
|
160
|
+
* support ruby 2.4 [John Cupitt]
|
161
|
+
|
162
|
+
## Version 1.0.3 (2016-08-18)
|
163
|
+
|
164
|
+
* doc improvements [John Cupitt]
|
165
|
+
* add `Image#size` to get `[width, height]` [John Cupitt]
|
166
|
+
* only ask for ruby 2.0 to help OS X [John Cupitt]
|
167
|
+
* break up `Image.call` to make it easier to understand [John Cupitt]
|
168
|
+
* detect operation build fail correctly [John Cupitt]
|
169
|
+
* lock gobject-introspection at 3.0.8 to avoid breakage [John Cupitt]
|
170
|
+
|
171
|
+
## Version 1.0.2 (2016-07-07)
|
172
|
+
|
173
|
+
* add `.yardopts` to fix ruby-gems docs [John Cupitt]
|
174
|
+
|
175
|
+
## Version 1.0.1 (2016-07-07)
|
176
|
+
|
177
|
+
* simplify gemspec [sandstrom]
|
178
|
+
* remove jeweler dependency [John Cupitt]
|
179
|
+
* add `.to_a` to Image [John Cupitt]
|
180
|
+
|
181
|
+
## Version 1.0.0 (2016-06-07)
|
182
|
+
|
183
|
+
* complete rewrite, API break [John Cupitt]
|
184
|
+
|
185
|
+
## Version 0.3.14 (2016-01-25)
|
186
|
+
|
187
|
+
* more GC tuning [felixbuenemann]
|
188
|
+
* add `write.rb` example program [felixbuenemann]
|
189
|
+
|
190
|
+
## Version 0.3.13 (2016-01-18)
|
191
|
+
|
192
|
+
* don't use generational GC options on old Rubys [John Cupitt]
|
193
|
+
|
194
|
+
## Version 0.3.12 (2016-01-17)
|
195
|
+
|
196
|
+
* incremental GC every 10 writes [felixbuenemann]
|
197
|
+
* updated bundle [John Cupitt]
|
198
|
+
|
199
|
+
## Version 0.3.11 (2015-10-15)
|
200
|
+
|
201
|
+
* added magick load from buffer [John Cupitt]
|
202
|
+
|
203
|
+
## Version 0.3.10 (2015-06-24)
|
204
|
+
|
205
|
+
* added webp write [John Cupitt]
|
206
|
+
|
207
|
+
## Version 0.3.9 (2014-07-17)
|
208
|
+
|
209
|
+
* removed a stray file from gemspec [Alessandro Tagliapietra]
|
210
|
+
* updated bundle [John Cupitt]
|
211
|
+
* revised spec tests [John Cupitt]
|
212
|
+
* fix a segv in im.label_regions [John Cupitt]
|
213
|
+
* add a Valgrind suppressions file [John Cupitt]
|
214
|
+
* fix .monotonic? [John Cupitt]
|
215
|
+
* fix .data on coded images [John Cupitt]
|
216
|
+
* add .size, see issue #58 [John Cupitt]
|
217
|
+
* add rdoc-data dep, maybe it will help ruby-gems docs [John Cupitt]
|
218
|
+
|
219
|
+
## Version 0.3.8 (2014-05-11)
|
220
|
+
|
221
|
+
* add VIPS::thread_shutdown(), must be called on foreign thread exit [John Cupitt]
|
222
|
+
|
223
|
+
## Version 0.3.7 (2014-02-04)
|
224
|
+
|
225
|
+
* update build dependencies [John Cupitt]
|
226
|
+
* README updated [John Cupitt]
|
227
|
+
|
228
|
+
## Version 0.3.6 (2013-06-25)
|
229
|
+
|
230
|
+
* add png and jpg load from memory buffer [John Cupitt]
|
231
|
+
* README updated to include buffer read/write example [John Cupitt]
|
232
|
+
* better vips version testing [John Cupitt]
|
233
|
+
* spec tests for new buffer read/write code [John Cupitt]
|
234
|
+
* fix rdoc build to include C sources [John Cupitt]
|
235
|
+
* better compat with older libvips [John Cupitt]
|
236
|
+
|
237
|
+
## Version 0.3.5 (2013-01-15)
|
238
|
+
|
239
|
+
* rb_raise() in mask.c no longer passes a string pointer as the fmt arg, stopping gcc bailing out on some platforms [John Cupitt]
|
240
|
+
* Image.magick() now calls im_magick2vips() directly rather than relying on libvips file type sniffing [John Cupitt]
|
241
|
+
|
242
|
+
## Version 0.3.4 (2012-09-11)
|
243
|
+
|
244
|
+
* Update specs for lcms changes, thanks Stanislaw [John Cupitt]
|
245
|
+
* VIPS::Reader supports .exif() / .exif?() methods for better back compat, thanks Jeremy [John Cupitt]
|
246
|
+
* VIPS::Reader fallbacks load the image if its not been loaded [John Cupitt]
|
247
|
+
* VIPS::Reader no longer allows VIPS::Header methods [John Cupitt]
|
248
|
+
|
249
|
+
## Version 0.3.3 (2012-08-31)
|
250
|
+
|
251
|
+
* Typo in workaround in 0.3.2 [John Cupitt]
|
252
|
+
|
253
|
+
## Version 0.3.2 (2012-08-31)
|
254
|
+
|
255
|
+
### Fixed
|
256
|
+
|
257
|
+
* Workaround helps ruby-vips compile (and run) against 7.26.3 [John Cupitt and
|
258
|
+
James Harrison]
|
259
|
+
|
260
|
+
## Version 0.3.1 (2012-08-30)
|
261
|
+
|
262
|
+
### Fixed
|
263
|
+
|
264
|
+
* PNG writer no longer changes the filename argument [John Cupitt]
|
265
|
+
* Workaround helps ruby-vips compile against 7.26.3 [John Cupitt]
|
266
|
+
* Image read now runs GC and retries on fail [John Cupitt]
|
267
|
+
* Image write GCs every 100 images [John Cupitt]
|
268
|
+
|
269
|
+
## Version 0.3.0 (2012-07-20)
|
270
|
+
|
271
|
+
### Added
|
272
|
+
|
273
|
+
* More rspec tests [John Cupitt]
|
274
|
+
* Updated to libvips-7.30 [John Cupitt]
|
275
|
+
|
276
|
+
### Changed
|
277
|
+
|
278
|
+
* Reworked Reader class offers better performance and compatibility [John
|
279
|
+
Cupitt]
|
280
|
+
* Don't use :sequential option for older libvipses [John Cupitt]
|
281
|
+
* Rename "tone_analyze" as "tone_analyse" for consistency with the rest of
|
282
|
+
vips [John CUpitt]
|
283
|
+
|
284
|
+
### Fixed
|
285
|
+
|
286
|
+
* Now passes rspec test suite cleanly in valgrind [John Cupitt]
|
287
|
+
* Fixed check of sequential mode support [Stanislaw Pankevich]
|
288
|
+
|
289
|
+
## Version 0.2.0 (2012-06-29)
|
290
|
+
|
291
|
+
### Added
|
292
|
+
|
293
|
+
* Add tile_cache [John Cupitt]
|
294
|
+
* Add :sequential option to tiff, jpeg and png readers [John Cupitt]
|
295
|
+
* Add raise if suitable pkg_config for libvips is not found, thanks to Pierre
|
296
|
+
Chapuis [Stanislaw Pankevich]
|
297
|
+
* Add backward compatibility of 0.1.x ruby-vips with libvips versions less than 7.28 [John Cupitt]
|
298
|
+
* Add Travis. ruby-vips now is being tested on travis-ci.org. [Stanislaw Pankevich]
|
299
|
+
|
300
|
+
### Changed
|
301
|
+
|
302
|
+
* Disable the vips8 operation cache to save some memory [John Cupitt]
|
303
|
+
* Update example shrinker [John Cupitt]
|
304
|
+
|
305
|
+
### Fixed
|
306
|
+
|
307
|
+
* #8: Memory allocation-free issues [Grigoriy Chudnov]
|
308
|
+
|
309
|
+
## Version 0.1.1 (2012-06-22)
|
310
|
+
|
311
|
+
### Changed
|
312
|
+
|
313
|
+
* Upgrade spec/* code to latest RSpec [Stanislaw Pankevich]
|
314
|
+
|
315
|
+
### Added
|
316
|
+
|
317
|
+
* Added CHANGELOG.md file (thanks to jnicklas/capybara - using the layout of their History.txt) [Stanislaw Pankevich]
|
318
|
+
* Added Gemfile with the only 'rspec' dependency. [Stanislaw Pankevich]
|
319
|
+
* Added Jeweler Rakefile contents to release ruby-vips as a gem. [Stanislaw Pankevich]
|
320
|
+
|
321
|
+
## Before (initial unreleased version 0.1.0)
|
322
|
+
|
323
|
+
Long-long history here undocumented...
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,29 +1,26 @@
|
|
1
1
|
# Vips
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/ruby-vips.svg)](https://badge.fury.io/rb/ruby-vips)
|
4
|
+
[![Test](https://github.com/libvips/ruby-vips/workflows/Test/badge.svg)](https://github.com/libvips/ruby-vips/actions?query=workflow%3ATest)
|
4
5
|
|
5
6
|
This gem is a backwards compatible fork of `ruby-vips` but also includes (and compiles) the [libvips] source code.
|
6
7
|
|
7
|
-
[
|
8
|
+
libvips is a [demand-driven, horizontally
|
9
|
+
threaded](https://github.com/libvips/libvips/wiki/Why-is-libvips-quick)
|
10
|
+
image processing library. Compared to similar
|
11
|
+
libraries, [libvips runs quickly and uses little
|
12
|
+
memory](https://github.com/libvips/libvips/wiki/Speed-and-memory-use).
|
13
|
+
libvips is licensed under the [LGPL
|
14
|
+
2.1+](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html).
|
8
15
|
|
9
16
|
[libvips]: https://libvips.github.io/libvips
|
10
17
|
|
11
18
|
## Installation
|
12
19
|
|
13
|
-
|
14
|
-
|
15
|
-
```ruby
|
16
|
-
gem 'vips'
|
20
|
+
``` shell
|
21
|
+
$ bundle add vips
|
17
22
|
```
|
18
23
|
|
19
|
-
And then execute:
|
20
|
-
|
21
|
-
$ bundle
|
22
|
-
|
23
|
-
Or install it yourself as:
|
24
|
-
|
25
|
-
$ gem install vips
|
26
|
-
|
27
24
|
You'll still need to install `glib` and `gobject-introspection`.
|
28
25
|
|
29
26
|
## Usage
|
@@ -40,7 +37,24 @@ Exactly the same way as [ruby-vips].
|
|
40
37
|
4. Push to the branch (`git push origin my-new-feature`)
|
41
38
|
5. Create new Pull Request
|
42
39
|
|
43
|
-
##
|
40
|
+
## Documentation
|
41
|
+
|
42
|
+
There are [full API docs for ruby-vips on
|
43
|
+
rubydoc](https://www.rubydoc.info/gems/ruby-vips). This sometimes has issues
|
44
|
+
updating, so we have a [copy on the gh-pages for this site as
|
45
|
+
well](http://libvips.github.io/ruby-vips), which
|
46
|
+
should always work.
|
47
|
+
|
48
|
+
See the `Vips` section in the docs for a [tutorial introduction with
|
49
|
+
examples](https://www.rubydoc.info/gems/ruby-vips/Vips).
|
50
|
+
|
51
|
+
The [libvips reference manual](https://libvips.github.io/libvips/API/current/)
|
52
|
+
has a complete explanation of every method.
|
53
|
+
|
54
|
+
The [`example/`](https://github.com/libvips/ruby-vips/tree/master/example)
|
55
|
+
directory has some simple example programs.
|
56
|
+
|
57
|
+
## Benchmarks
|
44
58
|
|
45
59
|
Released under the MIT license.
|
46
60
|
|
data/Rakefile
CHANGED
@@ -1,28 +1,33 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
-
require "rspec/core/rake_task"
|
3
2
|
|
4
|
-
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
warn e.message
|
7
|
+
warn "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
5
10
|
|
6
|
-
|
11
|
+
require "rake"
|
7
12
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
13
|
+
require "rspec/core"
|
14
|
+
require "rspec/core/rake_task"
|
15
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
16
|
+
spec.pattern = FileList["spec/**/*_spec.rb"]
|
12
17
|
end
|
13
18
|
|
14
|
-
task :
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
19
|
+
task default: :spec
|
20
|
+
|
21
|
+
task :ext do
|
22
|
+
Dir.chdir "ext" do
|
23
|
+
sh "rake"
|
24
|
+
end
|
20
25
|
end
|
21
26
|
|
22
|
-
|
27
|
+
unless RUBY_PLATFORM.include?("java")
|
28
|
+
require "github/markup"
|
29
|
+
require "yard"
|
30
|
+
require "yard/rake/yardoc_task"
|
23
31
|
|
24
|
-
YARD::Rake::YardocTask.new
|
25
|
-
require "yard"
|
26
|
-
require "github/markup"
|
27
|
-
require "redcarpet"
|
32
|
+
YARD::Rake::YardocTask.new
|
28
33
|
end
|
data/TODO
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Notes
|
2
|
+
|
3
|
+
- We should support complex constants, eg:
|
4
|
+
|
5
|
+
Complex(1, 2)
|
6
|
+
=> (1+2i)
|
7
|
+
|
8
|
+
# Common operations
|
9
|
+
|
10
|
+
- Lint.
|
11
|
+
|
12
|
+
bundle exec standardrb
|
13
|
+
|
14
|
+
- Reinstall local copy of gem after a change.
|
15
|
+
|
16
|
+
bundle exec rake install
|
17
|
+
|
18
|
+
- Run test suite.
|
19
|
+
|
20
|
+
bundle exec rake
|
21
|
+
|
22
|
+
- Version bump.
|
23
|
+
|
24
|
+
edit lib/vips/version.rb
|
25
|
+
edit VERSION
|
26
|
+
|
27
|
+
- Regenerate autodocs.
|
28
|
+
|
29
|
+
cd lib/vips
|
30
|
+
ruby > methods.rb
|
31
|
+
require "vips"; Vips::Yard.generate
|
32
|
+
^D
|
33
|
+
|
34
|
+
- Regenerate docs.
|
35
|
+
|
36
|
+
bundle exec rake yard
|
37
|
+
|
38
|
+
- Push new gem to rubygems, tag repository with version.
|
39
|
+
|
40
|
+
bundle exec rake release
|
41
|
+
|
42
|
+
You'll be asked for a otp from authy / google authenticator / etc.
|
43
|
+
|
data/example/annotate.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
|
3
|
-
require
|
3
|
+
require "vips"
|
4
4
|
|
5
|
-
im = Vips::Image.new_from_file ARGV[0], :
|
5
|
+
im = Vips::Image.new_from_file ARGV[0], access: :sequential
|
6
6
|
|
7
|
-
left_text = Vips::Image.text "left corner", :
|
7
|
+
left_text = Vips::Image.text "left corner", dpi: 300
|
8
8
|
left = left_text.embed 50, 50, im.width, 150
|
9
9
|
|
10
|
-
right_text = Vips::Image.text "right corner", :
|
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
|
-
footer = (left | right).ifthenelse(0, [255, 0, 0], :
|
13
|
+
footer = (left | right).ifthenelse(0, [255, 0, 0], blend: true)
|
14
14
|
|
15
|
-
im = im.insert footer, 0, im.height, :
|
15
|
+
im = im.insert footer, 0, im.height, expand: true
|
16
16
|
|
17
17
|
im.write_to_file ARGV[1]
|
data/example/connection.rb
CHANGED
@@ -1,17 +1,26 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
|
3
|
-
require
|
3
|
+
require "vips"
|
4
|
+
require "down/http"
|
5
|
+
|
6
|
+
# byte_source = File.open ARGV[0], "rb"
|
7
|
+
# eg. https://images.unsplash.com/photo-1491933382434-500287f9b54b
|
8
|
+
byte_source = Down::Http.open(ARGV[0])
|
4
9
|
|
5
|
-
file = File.open ARGV[0], "rb"
|
6
10
|
source = Vips::SourceCustom.new
|
7
|
-
source.on_read
|
8
|
-
|
9
|
-
|
11
|
+
source.on_read do |length|
|
12
|
+
puts "reading #{length} bytes ..."
|
13
|
+
byte_source.read length
|
14
|
+
end
|
15
|
+
source.on_seek do |offset, whence|
|
16
|
+
puts "seeking to #{offset}, #{whence}"
|
17
|
+
byte_source.seek(offset, whence)
|
18
|
+
end
|
10
19
|
|
11
|
-
|
20
|
+
byte_target = File.open ARGV[1], "wb"
|
12
21
|
target = Vips::TargetCustom.new
|
13
|
-
target.on_write { |chunk|
|
14
|
-
target.on_finish {
|
22
|
+
target.on_write { |chunk| byte_target.write(chunk) }
|
23
|
+
target.on_finish { byte_target.close }
|
15
24
|
|
16
25
|
image = Vips::Image.new_from_source source, "", access: :sequential
|
17
|
-
image.write_to_target target, ".
|
26
|
+
image.write_to_target target, ".jpg"
|