Using vips for creating derivatives

Hey there,

First, thanks a lot for this file upload toolkit!
Now to my question.
I am creating derivatives for my image uploads.
I was able to make ImageMagick work.
I wanted to switch to libvips to take advantage of its faster processing as compared to ImageMagick, but I am getting the following error:

NameError (undefined local variable or method `image’ for GenerateThumbnail:Class):

Here’s the code that’s failing (in lib/generate_thubmnail.rb):

require "image_processing/vips"

class GenerateThumbnail
  def, width, height)
  result = ["thumb-#{width}-#{height}", File.extname(file.path)]

  image = Vips::Image.thumbnail(file.path, width, height: height, size: :down)



Code above is based on Better File Uploads with Shrine: Eager Processing.

Thank you!


Have you tried debugging the code by commenting out lines or using pry or byebug and stepping into the console to understand the issue?