code: def source_custom(filename):
      input_file = open(sys.argv[1], "rb")
  
      def read_handler(size):
          return input_file.read(size)
  
      # seek is optional, but may improve performance by reducing buffering
      def seek_handler(offset, whence):
          input_file.seek(offset, whence)
          return input_file.tell()
  
      source = pyvips.SourceCustom()
      source.on_read(read_handler)
      source.on_seek(seek_handler)
  
      return source
  
label_desc: Use image node_id 1 for calling a global function with example usage: source_custom(filename) and returns: source, input_file, input_file