Skip to content

Commit

Permalink
Fix vobject method
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandlo committed Feb 3, 2025
1 parent dec498c commit 553bd11
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
4 changes: 4 additions & 0 deletions src/vips/Connection.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ Connection.new = function(vconnection)
connection.vconnection = vobject.new(vconnection)
return setmetatable(connection, Connection.mt)
end
function Connection_method:vobject()
return ffi.cast(vobject.typeof, self.vconnection)
end

function Connection_method:filename()
-- Get the filename asscoiated with a connection. Return nil if there is no associated file.
local so = ffi.cast('VipsConnection *', self.vconnection)
Expand Down
5 changes: 0 additions & 5 deletions src/vips/Source.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@
local ffi = require "ffi"

local verror = require "vips.verror"
local vobject = require "vips.vobject"
local Connection = require "vips.Connection"

local vips_lib = ffi.load(ffi.os == "Windows" and "libvips-42.dll" or "vips")

local Source = {}

Source.vobject = function(self)
return ffi.cast(vobject.typeof, self)
end

Source.new_from_descriptor = function(descriptor)
local source = vips_lib.vips_source_new_from_descriptor(descriptor)
if source == ffi.NULL then
Expand Down
5 changes: 0 additions & 5 deletions src/vips/Target.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@

local ffi = require "ffi"

local vobject = require "vips.vobject"
local Connection = require "vips.Connection"

local vips_lib = ffi.load(ffi.os == "Windows" and "libvips-42.dll" or "vips")

local Target = {}

Target.vobject = function(self)
return ffi.cast(vobject.typeof, self)
end

Target.new_to_descriptor = function(descriptor)
collectgarbage("stop")
local target = vips_lib.vips_target_new_to_descriptor(descriptor)
Expand Down

0 comments on commit 553bd11

Please sign in to comment.