vips-thumbnail 1.3.0 → 1.4.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: 9c15ade7023bae14d1397fecf07842d2ace71e9e0d708056e6613de39423d5eb
4
- data.tar.gz: '088ccb4fb7ac07135bbbfebd630b232edce4f8869beaee45e64fda135c923f6f'
3
+ metadata.gz: 519e0b660a6a4eaf5302b228fcf965f1aa92dafe5eef90027545fd4ac81ca946
4
+ data.tar.gz: 302b6e7a0f9386322e36476cf9676054b6f121dee424912bb8da17da81f33566
5
5
  SHA512:
6
- metadata.gz: f90342a5019f80050d02c2304cf99898f9f0fd63537a45902e5fe2aa2426747758c464f2d4194391dfbb1d67382340a5ec11a49036aee46fb9df91cbe0dfef81
7
- data.tar.gz: ca592fd027d520af82cf8c64e9caf202ef427ea4d8d8c8acc9d2b44b1598cfc5c7d8b14c8f29f7327b31e05c80bd92efde921653755d7f7ff3477f8c12694de3
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
- @options = options
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
- image = Vips::Image.new_from_file(@input_path, **@options)
42
- @input_image = image.autorot
45
+ @input_image = @block.call
43
46
  end
44
47
 
45
48
  return @input_image
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Vips
22
22
  module Thumbnail
23
- VERSION = "1.3.0"
23
+ VERSION = "1.4.0"
24
24
  end
25
25
  end
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.3.0
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-09 00:00:00.000000000 Z
11
+ date: 2018-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vips