Esempio n. 1
0
        public override IEntry Handle(IScrapedElement scrapedElement, int id)
        {
            if (scrapedElement is ScrapedPictureElement pictureElement)
            {
                byte[] pictureBytes      = DownloadPicture(pictureElement.Path);
                string ocrRawResponse    = OCR.ProcessImage(pictureElement.Path).Result;
                string parsedOCRResponse = ParseOCRResponse(ocrRawResponse);

                return(new PictureEntry()
                {
                    ID = id,
                    PicturePath = pictureElement.Path,
                    Picture = pictureBytes,
                    OCRResponse = parsedOCRResponse
                });
            }

            return(base.Handle(scrapedElement, id));
        }