Skip to content

Commit

Permalink
Allow options to be passed to input file loader.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Mar 30, 2017
1 parent 64aeaa4 commit c22edae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions lib/vips/thumbnail/resizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,22 @@
module Vips
module Thumbnail
class Resizer
def initialize(input_path)
def initialize(input_path, **options)
@input_path = input_path
@options = options
@input_image = nil
end

attr :input_path
attr :options

def flush!
@input_image = nil
end

def input_image
unless @input_image
image = Vips::Image.new_from_file(@input_path)
image = Vips::Image.new_from_file(@input_path, **@options)
@input_image = image.autorot
end

Expand Down
2 changes: 1 addition & 1 deletion lib/vips/thumbnail/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@

module Vips
module Thumbnail
VERSION = "1.0.2"
VERSION = "1.1.0"
end
end

0 comments on commit c22edae

Please sign in to comment.