diff --git a/spec/interpolate_spec.lua b/spec/interpolate_spec.lua index a05b699..d88c25a 100644 --- a/spec/interpolate_spec.lua +++ b/spec/interpolate_spec.lua @@ -7,7 +7,7 @@ describe("image interpolation", function() end) it("can rotate an image using nearest interpolator", function() - local interpolate = vips.Interpolate.new_from_name("nearest") + local interpolate = vips.Interpolate.new("nearest") local original = { { 1, 2, 3 }, { 4, 5, 6 }, diff --git a/src/vips/Interpolate.lua b/src/vips/Interpolate.lua index 1ccd979..5502159 100644 --- a/src/vips/Interpolate.lua +++ b/src/vips/Interpolate.lua @@ -13,18 +13,14 @@ Interpolate.vobject = function(self) return ffi.cast(vobject.typeof, self) end -Interpolate.new = function(self) - return vobject.new(self) -end - -Interpolate.new_from_name = function(name) +Interpolate.new = function(name) -- there could potentially be other params here, but ignore that for now local interpolate = vips_lib.vips_interpolate_new(name) if interpolate == nil then error("no such interpolator\n" .. verror.get()) end - return Interpolate.new(interpolate) + return vobject.new(interpolate) end return ffi.metatype("VipsInterpolate", {