fromFile static method

FaceIndexer fromFile(
  1. String? path
)

Imports the face indexer object from a file.

param path Path to the file to import the face indexer object from. return The newly created face indexer. throws FaceException An error has occurred during Face Library execution.

Implementation

static FaceIndexer fromFile(String? path) {
  FaceIndexer faceIndexer = FaceIndexer();
  Pointer<Char>? pPath = path?.toNativeUtf8().cast<Char>();
  try {
    var err = faceSDK.id3FaceIndexer_FromFile(faceIndexer.handle, pPath ?? nullptr);
    if (err != FaceError.success.value) {
      faceIndexer.dispose();
      throw FaceException(err);
    }
    return faceIndexer;
  } finally {
    if (pPath != null) {
      calloc.free(pPath);
    }
  }
}