I'm using GdPicture 9.0.0.12. In the example below I pass in a filePath to a TIFF file. The TIFF contains two lines of text upside down.
The value that comes out of oGdPictureImaging.OCRTesseractGetOrientation is always 0. Why is that?
At each stage GetStat() returns GdPictureStatus.OK.
Code: Select all
var licManager = new LicenseManager();
licManager.RegisterKEY(licenseKey);
licManager.RegisterKEY(pdfLicenseKey);
licManager.RegisterKEY(ocrLicenseKey);
using (var oGdPictureImaging = new GdPictureImaging())
{
int imageId = oGdPictureImaging.CreateGdPictureImageFromFile(filePath);
if (oGdPictureImaging.GetStat() != GdPictureStatus.OK)
throw new ApplicationException("Handle this 1.");
var result = oGdPictureImaging.AutoDeskew(imageId);
if (result != GdPictureStatus.OK)
throw new ApplicationException("Handle this 2.");
oGdPictureImaging.OCRTesseractReinit();
oGdPictureImaging.OCRTesseractClear();
oGdPictureImaging.OCRTesseractSetPassCount(2);
int rotation = oGdPictureImaging.OCRTesseractGetOrientation(imageId, dictionary,
dictionariesFolder.FullName);
if (oGdPictureImaging.GetStat() != GdPictureStatus.OK)
throw new ApplicationException("Handle this 3.");
...