class Utopia::Gallery::ResizeVector
Public Class Methods
new(*args, extension: ".png", scale: 1, **options)
click to toggle source
Calls superclass method
Utopia::Gallery::ResizeImage::new
# File lib/utopia/gallery/process.rb, line 116 def initialize(*args, extension: ".png", scale: 1, **options) super(*args, **options) @extension = extension @scale = scale end
Public Instance Methods
generate_output(resizer, output_path)
click to toggle source
# File lib/utopia/gallery/process.rb, line 126 def generate_output(resizer, output_path) if output_image = resizer.send(@method, @size) output_image.write_to_file output_path, **@options else resizer.input_image.write_to_file output_path, **@options end end
relative_path(media)
click to toggle source
Calls superclass method
Utopia::Gallery::ResizeImage#relative_path
# File lib/utopia/gallery/process.rb, line 122 def relative_path(media) super + @extension end
resizer_for(input_path)
click to toggle source
# File lib/utopia/gallery/process.rb, line 134 def resizer_for(input_path) Vips::Thumbnail::Resizer.new(input_path, scale: @scale) end