*** Archive *** Is there a way to use script to avoid the "The image classifier does not support images with less then 96 DPI" error when processing low DPI images through KTM Server using layout classification?
16742
16742
QAID # 16742 Published
Question / Problem:
Is there a way to use script to avoid the "The image classifier does not support images with less then 96 DPI" error when processing low DPI images through KTM Server using layout classification?
Answer / Solution:
Yes. The example script below shows how to detect the DPI before the layout classifier runs.
Setting bSkip
to true will prevent the error from occurring:
Private Sub Document_BeforeClassifyImage(ByVal pXDoc As CASCADELib.CscXDocument, ByVal PageNr As Long, ByRef bSkip As Boolean) Dim oImage As CscImage Set oImage = pXDoc.CDoc.Pages.ItemByIndex(PageNr).GetImage() 'The check if the resolution of this image is too low for the image classifier to process it. If oImage.XResolution < 96 Or oImage.YResolution < 96 Then 'Set bSkip to true to prevent the layout classifier from causing an error. bSkip = True 'If content or instruction classification is enabled 'they will still run after this and may classify the document. 'In a project with only layout classification 'it will go to the default class or be unclassified. End If End Sub
Applies to:
Product | Version | Category |
---|---|---|
AXPRO | 4.5 | Image Classifier |
AXPRO | 4.5 | Server |
AXPRO | 5.0 | Image Classifier |
AXPRO | 5.0 | Server |
AXPRO | 5.5 | Image Classifier |
AXPRO | 5.5 | Server |