public void UploadImage(string filePath) { byte[] fileContent = File.ReadAllBytes(filePath); string fileExtension = Path.GetExtension(filePath).ToLowerInvariant(); bool success = ImgDetectiveLib.UploadImg(fileContent, fileExtension); }
public bool CanIndexDirectory(string directoryPath, out string message) { message = null; var result = ImgDetectiveLib.CanIndexDirectory(directoryPath); switch (result) { case cswrapper.structs.CanIndexDirectoryResult.ResultEnum.AvailableForIndex: return(true); case cswrapper.structs.CanIndexDirectoryResult.ResultEnum.Unknown: case cswrapper.structs.CanIndexDirectoryResult.ResultEnum.AlreadyIndexed: case cswrapper.structs.CanIndexDirectoryResult.ResultEnum.NotAbsolute: case cswrapper.structs.CanIndexDirectoryResult.ResultEnum.NotExists: case cswrapper.structs.CanIndexDirectoryResult.ResultEnum.SubdirIndexed: case cswrapper.structs.CanIndexDirectoryResult.ResultEnum.IsNotDir: return(false); default: throw new InvalidOperationException("Unknown value of the enum CanIndexDirectoryResult.ResultEnum: " + result.ToString()); } }
public SearchResult SearchByExample(string filePath) { byte[] exampleImgContent = File.ReadAllBytes(filePath); return(ImgDetectiveLib.Search(exampleImgContent)); }
public void IndexDirectory(string directoryPath) { ImgDetectiveLib.IndexDirectory(directoryPath); }