diff --git a/package.json b/package.json index 8d11449..c0a3f80 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "0.0.36", + "version": "0.0.37", "author": "Regula Forensics, Inc.", "name": "@regulaforensics/document-reader-recipes", "description": "Document Reader Recipes", diff --git a/src/recipes/image/document-images/get-document-images.recipe.ts b/src/recipes/image/document-images/get-document-images.recipe.ts index 53d8097..de5be9b 100644 --- a/src/recipes/image/document-images/get-document-images.recipe.ts +++ b/src/recipes/image/document-images/get-document-images.recipe.ts @@ -15,11 +15,13 @@ import { RDocumentImage, RDocumentImagePage } from './models' * Get document images * @param {ProcessResponse} input * @param {eGraphicFieldType[]|undefined} fieldTypes +* @param {eResultType[]|undefined} containerTypes * @returns {Promise} */ export const getDocumentImages = async ( input: ProcessResponse, - fieldTypes?: eGraphicFieldType[] + fieldTypes?: eGraphicFieldType[], + containerTypes?: eResultType[] ): Promise => { const result: RDocumentImage[] = [] @@ -41,7 +43,7 @@ export const getDocumentImages = async ( const { lightIndex, pageIndex, value, containerType } = page - if (containerType !== eResultType.DOCUMENT_IMAGE) { + if (containerTypes && !containerTypes.includes(containerType)) { continue } @@ -79,11 +81,13 @@ export const getDocumentImages = async ( * Get document images (synchronous version - without image dimensions) * @param {ProcessResponse} input * @param {eGraphicFieldType[]|undefined} fieldTypes +* @param {eResultType[]|undefined} containerTypes * @returns {Promise} */ export const getDocumentImagesSync = ( input: ProcessResponse, - fieldTypes?: eGraphicFieldType[] + fieldTypes?: eGraphicFieldType[], + containerTypes?: eResultType[] ): RDocumentImage[] => { const result: RDocumentImage[] = [] @@ -104,7 +108,7 @@ export const getDocumentImagesSync = ( const { lightIndex, pageIndex, value, containerType } = page - if (containerType !== eResultType.DOCUMENT_IMAGE) { + if (containerTypes && !containerTypes.includes(containerType)) { continue }