Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/paperclip-vips/paperclip/vips.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def make
destination = TempfileFactory.new.generate(filename)

begin
thumbnail = ::Vips::Image.thumbnail(source.path, width, { height: crop ? height : nil, crop: crop }) if @target_geometry
thumbnail = ::Vips::Image.thumbnail(source.path, width, **{ height: crop ? height : nil, crop: crop }) if @target_geometry
thumbnail = ::Vips::Image.new_from_file(source.path) if !defined?(thumbnail) || thumbnail.nil?
thumbnail = process_convert_options(thumbnail)
save_thumbnail(thumbnail, destination.path)

rescue => e
if @whiny
message = "There was an error processing the thumbnail for #{@basename}:\n" + e.message
Expand Down Expand Up @@ -68,7 +68,7 @@ def width
def height
@target_geometry&.height || @current_geometry.height
end

def process_convert_options(image)
if image
commands = parsed_convert_commands(@convert_options)
Expand Down