vips-thumbnail 1.3.0 → 1.4.0
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 +4 -4
- data/lib/vips/thumbnail/resizer.rb +7 -4
- data/lib/vips/thumbnail/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 519e0b660a6a4eaf5302b228fcf965f1aa92dafe5eef90027545fd4ac81ca946
|
4
|
+
data.tar.gz: 302b6e7a0f9386322e36476cf9676054b6f121dee424912bb8da17da81f33566
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6267ec8a930bfb094b7df70766a2fdad70ac87ba321d48474e1be5c02abcc9f84231b7ddb0473303aad3da1785d5b1a9017565c19af5241ba165740c0e4c3d1
|
7
|
+
data.tar.gz: a035d50020cd8c837e89f1a326e7062687ed8b1b93f203bfceda6a664ee65c3f43a0bac64517032cd016a0ca277eb797b285b589252878c2a44aeb01b7ede72f
|
@@ -23,9 +23,13 @@ require 'vips'
|
|
23
23
|
module Vips
|
24
24
|
module Thumbnail
|
25
25
|
class Resizer
|
26
|
-
def initialize(input_path, **options)
|
26
|
+
def initialize(input_path = nil, **options, &block)
|
27
27
|
@input_path = input_path
|
28
|
-
|
28
|
+
|
29
|
+
@block = block || lambda do
|
30
|
+
Vips::Image.new_from_file(@input_path, autorotate: true, **options)
|
31
|
+
end
|
32
|
+
|
29
33
|
@input_image = nil
|
30
34
|
end
|
31
35
|
|
@@ -38,8 +42,7 @@ module Vips
|
|
38
42
|
|
39
43
|
def input_image
|
40
44
|
unless @input_image
|
41
|
-
|
42
|
-
@input_image = image.autorot
|
45
|
+
@input_image = @block.call
|
43
46
|
end
|
44
47
|
|
45
48
|
return @input_image
|
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.
|
4
|
+
version: 1.4.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: 2018-05-
|
11
|
+
date: 2018-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: vips
|