vips-thumbnail 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/vips/thumbnail/resizer.rb +8 -2
- data/lib/vips/thumbnail/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccf3f508ee8bc738617a58479d9266e4fc89689f
|
4
|
+
data.tar.gz: 66fed5439017df61d03b82025db40926af4799fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1c4863fb4c6829c9e0f541c524aac46db799ba31d8aa02e36d39e3b6cebe6f587edab25d033e4255b61ce043280023e6a53c0188b237f1c335e996842099752
|
7
|
+
data.tar.gz: f5cff9ad8a3ab9f1cfade7ca859285f68fb62219653178db374e77748fa8cc3569508a01e2dbab897cbce4ff4cdd5b60d8ab17b0ff9129700ccbbe080a495b9d
|
data/README.md
CHANGED
@@ -22,6 +22,10 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
$ gem install vips-thumbnail
|
24
24
|
|
25
|
+
### Minimum Version
|
26
|
+
|
27
|
+
`libvips` has some [integer truncation issues](https://github.com/jcupitt/ruby-vips/issues/82) in versions < 8.4, so you *must* use a release >= 8.4 otherwise you may experience problems with `resize_to_fill`.
|
28
|
+
|
25
29
|
## Usage
|
26
30
|
|
27
31
|
It's super easy:
|
@@ -23,16 +23,22 @@ require 'vips'
|
|
23
23
|
module Vips
|
24
24
|
module Thumbnail
|
25
25
|
class Resizer
|
26
|
-
def initialize(input_path)
|
26
|
+
def initialize(input_path, **options)
|
27
27
|
@input_path = input_path
|
28
|
+
@options = options
|
28
29
|
@input_image = nil
|
29
30
|
end
|
30
31
|
|
31
32
|
attr :input_path
|
33
|
+
attr :options
|
34
|
+
|
35
|
+
def flush!
|
36
|
+
@input_image = nil
|
37
|
+
end
|
32
38
|
|
33
39
|
def input_image
|
34
40
|
unless @input_image
|
35
|
-
image = Vips::Image.new_from_file(@input_path)
|
41
|
+
image = Vips::Image.new_from_file(@input_path, **@options)
|
36
42
|
@input_image = image.autorot
|
37
43
|
end
|
38
44
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vips-thumbnail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-vips
|