Пример #1
0
        public void UploadImage(string filePath)
        {
            byte[] fileContent   = File.ReadAllBytes(filePath);
            string fileExtension = Path.GetExtension(filePath).ToLowerInvariant();

            bool success = ImgDetectiveLib.UploadImg(fileContent, fileExtension);
        }
Пример #2
0
        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());
            }
        }
Пример #3
0
        public SearchResult SearchByExample(string filePath)
        {
            byte[] exampleImgContent = File.ReadAllBytes(filePath);

            return(ImgDetectiveLib.Search(exampleImgContent));
        }
Пример #4
0
 public void IndexDirectory(string directoryPath)
 {
     ImgDetectiveLib.IndexDirectory(directoryPath);
 }