Example #1
0
        private SearchResult GetOriginalImageResult()
        {
            var result = new SearchResult(Color.White, ORIGINAL_IMAGE_NAME, m_imgUrl)
            {
                Similarity  = 100.0f,
                IsProcessed = true,
                IsImage     = true
            };

            result.ExtendedInfo.Add($"Location: {m_img}");

            var fileFormat = FileOperations.ResolveFileType(m_img.FullName);

            double fileSizeMegabytes =
                Mem.ConvertToUnit(FileOperations.GetFileSize(m_img.FullName), MetricUnit.Mega);

            (int width, int height) = (m_bmp.Width, m_bmp.Height);

            result.Width  = width;
            result.Height = height;


            var mpx = Mem.ConvertToUnit(width * height, MetricUnit.Mega);

            string infoStr = $"Info: {m_img.Name} ({fileSizeMegabytes:F} MB) ({mpx:F} MP) ({fileFormat.Name})";

            result.ExtendedInfo.Add(infoStr);

            return(result);
        }