Join us for an engaging webinar, as we unravel the potential of AI for revolutionizing document management.
Watch Now
Enable your employees to remain productive throughout the document management process.
Read More
Learn how SmartZone uses a regular expression engine integrated into the recognition engine to achieve the best possible accuracy on data that can be defined by a regular expression.
Docubee is an intelligent contact automation platform built to help your team success
I encounter an Unhandled Exception error, as shown below, in ImageGear when trying to load a page into the recognition engine.
Error Message: An unhandled exception of type ‘ImageGear.Core.ImGearException’ occurred in ImageGear22.Core.dll Additional information: IMG_DPI_WARN (0x4C711): Non-supported resolution. Value1:0x4C711
Error Message: An unhandled exception of type ‘ImageGear.Core.ImGearException’ occurred in ImageGear22.Core.dll
Additional information: IMG_DPI_WARN (0x4C711): Non-supported resolution. Value1:0x4C711
What is causing this and how can I fix it?
This is probably because the original image used to create the page didn’t have a Resolution Unit set.
To fix this, check if the page has a Resolution Unit set. If it does not, set it to inches. You should also set the DPI of the image as those values were probably not carried over from the original image since the Resolution Unit wasn’t set. The following code demonstrates how to do this.
// Open file and load page. using (var inStream = new FileStream(@"C:\Path\To\InputImage.jpg", FileMode.Open, FileAccess.Read, FileShare.Read)) { // Load first page. ImGearPage igPage = ImGearFileFormats.LoadPage(inStream, firstPage); if (igPage.DIB.ImageResolution.Units == ImGearResolutionUnits.NO_ABS) { igPage.DIB.ImageResolution.Units = ImGearResolutionUnits.INCHES; igPage.DIB.ImageResolution.XNumerator = 300; igPage.DIB.ImageResolution.XDenominator = 1; igPage.DIB.ImageResolution.YNumerator = 300; igPage.DIB.ImageResolution.YDenominator = 1; } using (var outStream = new FileStream(@"C:\Path\To\OutputImage.jpg", FileMode.OpenOrCreate, FileAccess.ReadWrite)) { // Import the page into the recognition engine. using (ImGearRecPage recognitionPage = recognitionEngine.ImportPage((ImGearRasterPage)igPage)) { // Preprocess the page. recognitionPage.Image.Preprocess(); // Perform recognition. recognitionPage.Recognize(); // Write the page to the output file. recognitionEngine.OutputManager.DirectTextFormat = ImGearRecDirectTextFormat.SimpleText; recognitionEngine.OutputManager.WriteDirectText(recognitionPage, outStream); } } }